Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (13 sloc) 0.455 kb
do ($ = jQuery) ->
konaMeFunctions = []
konamiCode = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]
konamiPos = 0
runKonaMe = ->
if konaMeFunctions.length > 0
konaMeFunctions[ Math.floor(Math.random() * konaMeFunctions.length) ]()
$(document).keyup (e) ->
if e.keyCode == konamiCode[konamiPos]
runKonaMe() if (konamiPos += 1) >= konamiCode.length
else
konamiPos = 0
window.konaMe = (fn) -> konaMeFunctions.push(fn)
Jump to Line
Something went wrong with that request. Please try again.