Skip to content

Instantly share code, notes, and snippets.

View oconnore's full-sized avatar

Eric O'Connor oconnore

View GitHub Profile
@oconnore
oconnore / event_mixin.js
Created July 30, 2013 21:43
Backbone style events
(function(exports) {
'use strict';
/*
activecontexts is a two level map
Map(object -> Map(context -> true))
The second map is simply used for efficient set lookup (has)
*/
var activecontexts = new WeakMap();
@oconnore
oconnore / @rfreeburn
Created June 22, 2013 02:58
Twitter response
Hey Ryan,
I thought this would be the easiest way to answer you in 140+ characters.
My first point is that the entropy of a random string is not defined by the number of possible characters. If you were to randomly pick a number between 1 and 100, and I randomly picked seven 1's or 0's, my string would have more entropy
log(100,2) = 6.64
and
2^7 > 2^6.64