Skip to content

Instantly share code, notes, and snippets.

@akinnee
Last active August 29, 2015 14:04
Show Gist options
  • Save akinnee/a8d6fe6b3b1c1b62b5aa to your computer and use it in GitHub Desktop.
Save akinnee/a8d6fe6b3b1c1b62b5aa to your computer and use it in GitHub Desktop.
var obj = {
konamiCodeActive: false,
konamiCodeListener: function() {
if ( window.addEventListener ) {
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
window.addEventListener("keydown", function(e){
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 && !obj.konamiCodeActive) {
obj.konamiCodeActive = true;
// Do SECReT STuFF HERE
}
}, true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment