Skip to content

Instantly share code, notes, and snippets.

View nathansmyth's full-sized avatar

Nathan Smyth nathansmyth

View GitHub Profile
@nathansmyth
nathansmyth / konami_code.js
Created June 10, 2015 22:24
konami code for keyboard easter eggs
// modified from http://www.paulirish.com/2009/cornify-easter-egg-with-jquery/#comment-68011
var APP = APP || {};
APP.konami_keys = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
APP.konami_index = 0;
$(document).keydown(function (e) {
if (e.keyCode === APP.konami_keys[APP.konami_index++]) {
if (APP.konami_index === APP.konami_keys.length) {
$(document).unbind('keydown', arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js', function () {