Skip to content

Instantly share code, notes, and snippets.

View achakravarty's full-sized avatar

Abhimanyu Chakravarty achakravarty

View GitHub Profile
@achakravarty
achakravarty / privacy-policy.md
Created February 13, 2026 07:15
Tab Click Chrome Extension - Privacy Policy

Tab Click Privacy Policy

Tab Click does not collect, store, or transmit any personal data.

The only data stored is your per-site enable/disable preference, which is saved locally in your browser using Chrome's built-in storage API (chrome.storage.sync). This data never leaves your browser except through Chrome's own sync service if you have Chrome Sync enabled.

Tab Click does not use analytics, tracking, cookies, or any external services. There are no servers — the extension runs entirely within your browser.

No data is sold or transferred to third parties for any purpose.

@achakravarty
achakravarty / Inferable.ts
Last active April 10, 2019 05:13
Simple type inference for properties of an object
type Inferable<T, K extends keyof T> = T[K] extends Function ? T[K] : never;
function asInferable<T, K extends keyof T>(_: T, key: K): (fn: Inferable<T, K>) => void {
return function(fn: Inferable<T, K>) {
console.log(fn("world"));
};
}
class Foo {
bar(str: string): string {
@achakravarty
achakravarty / dateTest.spec.js
Created May 4, 2017 14:55
Testing Date with sinon using fakeTimers and spies
const sinon = require('sinon');
const { expect } = require('chai');
describe('Timer', () => {
it('should verify Date constructor called', () => {
let dateSpy = sinon.spy(global, 'Date');
const date = new Date();
expect(dateSpy.calledWithNew()).to.be.true;
dateSpy.restore();
});
@achakravarty
achakravarty / app.js
Created November 11, 2013 05:18
Sample code for demonstrating jQuery validations with Ember.js
var App = Ember.Application.create();
App.Router.map(function(){
this.resource('user');
});
App.UserController = Ember.ObjectController.extend(Ember.Evented, {
actions: {
submit: function(){
var validation = {isValid: false};