Skip to content

Instantly share code, notes, and snippets.

@lean8086
Last active December 11, 2015 20:58
Show Gist options
  • Save lean8086/4658694 to your computer and use it in GitHub Desktop.
Save lean8086/4658694 to your computer and use it in GitHub Desktop.
/**
* Konami Code
* @example
* konami(function () {
* alert("easter egg!");
* });
*/
function konami(success) {
var keys = '',
path = '38384040373937396665';
addEventListener('keydown', function check(ev) {
if ((keys += ev.keyCode) === path) {
removeEventListener('keydown', check);
if (success !== undefined) {
success();
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment