I hereby claim:
- I am evinism on github.
- I am evin (https://keybase.io/evin) on keybase.
- I have a public key ASA1VVl2QJhgpn5JxFwEhxcK8Uk_PuwkO8sgP5d75lMzLwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// copy paste this script into the JS console on xkcd.com | |
// you can open the js console by pressing cmd-alt-j | |
// or by right clicking, pressing "inspect element", and navigating to the tab that says console. | |
const amt = 2000; | |
$('body').html(''); | |
const getImageUrl = (num) => 'http://generated.inspirobot.me/00' + (Math.floor(num / 10000) + 1) + '/aXm' + (num - Math.floor(num / 10000)*10000 + 1) + 'xjU.jpg'; |
=== Background === | |
For one issue at work, we tossed around the idea of generating UUIDs | |
clientside in order to ensure that we had a unique immutable id without | |
having to go to the server to get an ID back, primarily for p2p applications. | |
Obviously, if somebody's maliciously creating ids, they can choose arbitrary | |
values and create collisions. Additionally, one client could tell if another | |
client had already chosen a certain value for an id by trying to commit a | |
certain UUID to the db. |
λf.λx.f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.b)(f(λa.λb.a)(f(λa.λb.a)(f(λa.λ |
MilliEQL is a small query language built for embedding within applications. It supports logic for querying and manipulating data in a simple, typesafe manner.
Having a simple query language allows
const bareStrings = new Proxy({}, { | |
has(_, prop){ | |
return window[prop] === undefined; | |
}, | |
get(_, prop){ | |
return prop.toString(); | |
} | |
}); | |
with(bareStrings){ |
const cat = { | |
variant: 'hunter', | |
preferredPrey: 'anything', | |
} | |
const dog = { | |
variant: 'sniffer', | |
smellSkill: 'excellent' | |
} |
class Indexable { | |
constructor(){ | |
this._indexer = Symbol(); | |
} | |
[Symbol.toPrimitive](){ return this._indexer } | |
} | |
class Animal extends Indexable {} | |
const cat = new Animal(); |
function only(definedItems){ | |
return new Proxy({}, { | |
has(_, prop){ | |
return !definedItems.includes(prop); | |
}, | |
get(_, prop){ | |
throw new Error("Referenced variable " + prop.toString() + " out of scope!"); | |
}, | |
set(_, prop){ | |
throw new Error("Referenced variable " + prop.toString() + " out of scope!"); |
function uncomment(fn){ | |
const body = fn.toString().replace(/\/\//, ''); | |
return new Function(`return (${body})(...arguments)`); | |
} | |
function fn(a){ | |
// return a + 1; | |
return a | |
} |