I hereby claim:
- I am inpermutation on github.
- I am inpermutation (https://keybase.io/inpermutation) on keybase.
- I have a public key whose fingerprint is 9DD6 1265 C7C7 351A 195B 8FBF 9DAB 2EE3 2923 AB
To claim this, I am signing this object:
/// <summary>Used to enforce type nesting</summary> | |
public interface HList { } | |
public class Empty : HList { } | |
public class Stack<T, TChild> : HList where TChild : HList | |
{ | |
public T Item { get; private set; } | |
public TChild Child { get; private set; } |
I hereby claim:
To claim this, I am signing this object:
// First declare the "type" of Contact | |
var Contact = new | |
{ | |
First = (string)null, | |
Last = (string)null, | |
FullName = (Func<string>)null, | |
}; | |
// Then, assign a closure over Contact to FullName to implement the "method" | |
Contact = new | |
{ |
s = 'amsterdam|london|tokyo|indianapolis|new york|shanghai|toronto|san francisco' | |
rg = s.split('|') | |
# count: the length of the shortest word | |
count = len(min(rg, key=len)) | |
# v: list of sets. v[0] is the set of all the first letters, etc. | |
v = [] | |
for i in range(0,count): | |
v.append(set(w[i] for w in rg)) |
var aggregate_scores_by_lol = function(votes, lols, users){ | |
var vote_count = lols.reduce(function(p,lol,i,r){ return p[lol.id] = 0, p; }, {}); | |
var lol_dictionary = lols.reduce(function(p,lol,i,r){ return p[lol.id] = lol, p}, {}); | |
votes.forEach(function(vote){ vote_count[vote.lol_id]++; }); | |
var vote_count_keys = vote_count.map(function(el,ix){ return ix;}); | |
var sorted_lol_ids = vote_count_keys.sort(function(a, b){ | |
return vote_count[b] - vote_count[a]; |
function mysqlConfigFromEnvironment (){ | |
var dbUrl = process.env.DATABASE_URL; | |
var parsed = url.parse(dbUrl); | |
return { | |
host: parsed.host, | |
port: parsed.port || 3306, | |
user: parsed.auth.split(':')[0], | |
password: parsed.auth.split(":")[1] | |
}; | |
}; |
d6, roll a die | |
============== | |
rolls a 1 | |
rolls a 2 | |
rolls a 3 | |
rolls a 4 | |
rolls a 5 | |
rolls a 6 | |
d12 |
var p = require('./program'); | |
for(var dep in p) { | |
global[dep] = p[dep]; | |
} |
var r = recurse(process.argv[2] || 5000, 0); | |
console.log('found', r); | |
function recurse(n, j) { | |
if(n>0) return recurse(n-1, j+1); | |
else return j; | |
} |
function throwup(fxn) { | |
return function() { | |
throw [fxn, Array.prototype.slice.call(arguments)]; | |
} | |
} | |
function makecallable(fxn) { | |
return function() { | |
var params = Array.prototype.slice.call(arguments); | |
while(params) { |