Skip to content

Instantly share code, notes, and snippets.

@fzf
Last active December 19, 2015 13:09
Show Gist options
  • Save fzf/5960286 to your computer and use it in GitHub Desktop.
Save fzf/5960286 to your computer and use it in GitHub Desktop.
$(function () {
// konami code - up up down down left right left right b a
var konami = String.fromCharCode(38, 38, 40, 40, 37, 39, 37, 39, 66, 65);
var codeBuffer = "";
$(document).keyup(function (e) {
codeBuffer += String.fromCharCode(e.which);
if (konami.substring(0, codeBuffer.length) == codeBuffer) {
if (konami.length == codeBuffer.length) {
ba();
}
} else {
codeBuffer = "";
}
});
function ba() {
// do awesome
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment