Found this on Reddit comments while reading about Facebook implementing the code on their pages. (heh)
Here’s how to do this.
konami = function()
{
alert('konami');
};
var r = [];
document.onkeydown = function(event)
{
r.push(event.keyCode);
if (r.length > 11)
r.shift();
if (r.join('') == '3838404037393739666513')
konami();
};
Demo here.
Konamicodesites.com has a list of the websites implementing the Konami codes.