Archive

Archive for February, 2009

Cornify Konami easter egg plugin with jQuery

February 4th, 2009

No doubt you've heard that Cornifying is the latest and greatest invention of the internet.

Now you can surreptitiously add it to your own sites, joining The Underground Cabal of Mirthful Protectors of the Corn:

var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
  kkeys.push( e.keyCode );
  if ( kkeys.toString().indexOf( konami ) >= 0 ){
    $(document).unbind('keydown',arguments.callee);
    $.getScript('http://www.cornify.com/js/cornify.js',function(){
      cornify_add();
      $(document).keydown(cornify_add);
    });          
  }
});

After a user hits the Konami code (up,up,down,down,left,right,left,right,b,a), every other keystroke will add happiness to the world.

You'll find this website has already been enabled. Try it out. :)

Update 2009.04.27: It was discovered today ESPN.com was hiding some unicorns under its konami. (kotaku coverage) In fact it had been up there for weeks. :)

2010.05.29: BoingBoing will probably add it. And yeah this feature kinda triggered a meme. :p

Paul Irish jquery

i left this space here for you to play. <3