Skip to content

Instantly share code, notes, and snippets.

View srir's full-sized avatar

sri raghavan srir

View GitHub Profile
@srir
srir / lists.ts
Last active August 29, 2015 14:27
export function dedupeLists<T>(listOfLists: T[][], hash: (obj: T) => string): T[][] {
var all: { [hash: string]: boolean; } = {};
var resultList: T[][] = [];
listOfLists.forEach((list) => {
var results: T[] = [];
list.forEach((obj) => {
var key = hash(obj);
if (!all.hasOwnProperty(key)) {
@srir
srir / keybase.md
Created October 27, 2014 22:10
keybase.md

Keybase proof

I hereby claim:

  • I am srir on github.
  • I am srir (https://keybase.io/srir) on keybase.
  • I have a public key whose fingerprint is 1C17 7395 5186 844F 5ACB 3A6B 5AD1 30A5 951A 94FA

To claim this, I am signing this object:

/**
* "Like" everything posted by people named "Tess Rinearson" on Facebook. I could easily generalize this, but I "like"
* this better.
*
* Just run this in your Chrome console.
*/
(function(){
/**
* Gets a random number in the specified range, because Javascript is like tihs