Skip to content

Instantly share code, notes, and snippets.

@tmathews
Last active October 11, 2017 23:45
Show Gist options
  • Save tmathews/f1f89ba786dd2e68dabbb019b2658a28 to your computer and use it in GitHub Desktop.
Save tmathews/f1f89ba786dd2e68dabbb019b2658a28 to your computer and use it in GitHub Desktop.
function k (c, b) {
var x = c.concat()
window.addEventListener('keyup', function(e) {
if (x.shift() != e.keyCode) x = c.concat()
if (!x.length && x.concat(c)) b()
})
}
k([38,38,40,40,37,39,37,39,66,65], alert.bind(null, 'hi'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment