Created
March 30, 2010 17:21
-
-
Save amiel/349323 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!$.isFunction(Array.prototype.rand)) { | |
Array.prototype.rand = function() { | |
function rand(n) { return Math.floor(Math.random() * n); } | |
return this[rand(this.length)]; | |
}; | |
} | |
$.konamiAdrian = (function() { | |
var fns = [], konami = function() { fns.rand()(); }; | |
$.konami(konami); | |
return function(fn) { | |
fns.push(fn); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment