Skip to content

Instantly share code, notes, and snippets.

@scottstanfield
Created September 5, 2013 14:21
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save scottstanfield/6450745 to your computer and use it in GitHub Desktop.
Save scottstanfield/6450745 to your computer and use it in GitHub Desktop.
cornify.js: konami code with rainbows and unicorns
// Modified to 'a a' instead of 'b a' due to vimium conflict
// ▲ ▲ ▼ ▼ ◀ ▶ ◀ ▶ a a
// example page: http://yckart.github.io/jquery.konami.js/
//
var kkeys = [], konami = "38,38,40,40,37,39,37,39,65,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
$(document).unbind('keydown',arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js',function(){
cornify_add();
$(document).keydown(cornify_add);
});
}
});
@scottstanfield
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment