Skip to content

Instantly share code, notes, and snippets.

@Westixy
Last active September 13, 2018 19:56
Show Gist options
  • Save Westixy/b694240fa36af6c16bfe6fba18d6930c to your computer and use it in GitHub Desktop.
Save Westixy/b694240fa36af6c16bfe6fba18d6930c to your computer and use it in GitHub Desktop.
konami code as one-liner and tricky for fun
(
(a, ks = '38384040373937396665', e = document.body, k = 0) =>
e.addEventListener('keydown', ke =>
+ks.slice(k*2,k*2+2) === ke.keyCode
? ++k >= ks.length/2
? a(e,k = 0)
: null
: k = 0
)
)(x => x.style.fontFamily = 'monospace')
((a, ks='38384040373937396665', e=document.body, k=0) => e.addEventListener('keydown', ke => +ks.slice(k*2,k*2+2)===ke.keyCode ? ++k>=ks.length/2 ? a(e,k=0) : null : k=0))(x=>x.style.fontFamily='monospace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment