Skip to content

Instantly share code, notes, and snippets.

@adamcbrewer
Created November 4, 2012 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamcbrewer/4012455 to your computer and use it in GitHub Desktop.
Save adamcbrewer/4012455 to your computer and use it in GitHub Desktop.
JS: Konami Code
// Konami code with jQuery.
// Source: http://paulirish.com/2009/cornify-easter-egg-with-jquery/
var kkeys = [],
konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(evt) {
kkeys.push( evt.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
$(document).unbind('keydown',arguments.callee);
// your easter egg here
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment