Skip to content

Instantly share code, notes, and snippets.

@scrubmx
Forked from scottstanfield/cornify.js
Created March 10, 2016 22:09
Show Gist options
  • Save scrubmx/0e944cf5a0b630ef3159 to your computer and use it in GitHub Desktop.
Save scrubmx/0e944cf5a0b630ef3159 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);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment