Skip to content

Instantly share code, notes, and snippets.

@kombucha
kombucha / konami.js
Last active October 22, 2017 20:45
Simple konami code function for easter eggs
function konami(cb) {
// up up down down right left right left b a
var KONAMI_SEQ = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
var KONAMI_STR = KONAMI_SEQ.join(" ");
var keyCodeSeq = [];
window.addEventListener("keyup", function(e) {
keyCodeSeq.push(e.keyCode);
if (keyCodeSeq.length > KONAMI_SEQ.length) {
keyCodeSeq.shift();
@kombucha
kombucha / .jscsrc
Last active August 29, 2015 14:07
My .jscsrc
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],