There are a lot of Konami Code easter eggs out there and also a lot of guides on how to implement your own. Most of these guides have one thing in common; they are using overly verbose code for something you could fit inside a Twitter tweet.
The last week I’ve seen a dozens of blog posts related to Facebook’s, Jquery’s and many others hidden implementation of the ‘Konami code’ and how to implement one yourself.
One of the things I noticed was that people tend to write very verbose code, meaning, they tend to write a lot more code then they need too. Take a look at Abhi’s 30-rows implementation or Trevor’s Cheat Code Jquery plugin(!).
There are numbers of valid explanations to why people write verbose code; to be overly clear for educational purposes is one. But if you do that, I think you should also teach people that they shouldn’t make a habit out of it, especially when it comes to something so small that it fits inside a Twitter tweet.
// Tweetable Konami code
var k=[];addEventListener("keyup",function(e){ k.push(e.keyCode);if(k.toString().indexOf("38,38,40,40,37,39,37,39,66,65")>=0)cheat()},true);
The code above will fire the function cheat() when you enter the Konami Code (up,up,down,down,left,right,left,right,b,a). The code might be a bit too concies, but I was mainly trying to make a point.
Haven’t seen the Konami Code in action?
Go to www.facebook.com and login. Click once anywhere on your home page and type the following sequence using your keyboard: Up, Up, Down, Down, Left, Right, Left, Right, B, A, Enter Key. Click again or scroll the page.
Norwegians builds a web page out of wood
The “idea entrepreneurs” Melvær&Lien has created a web page out of wooden beams, plywood, some paint, nails, screws and a bird house.
The “idea entrepreneurs” Melvær&Lien has created a web page out of wooden beams, plywood, some paint, nails, screws and a bird house. According to Melvær blog they had a couple of days to spare and decided to do something different. “I have wanted to literally build a website for a while so this seemed like the perfect occasion to have a bit of fun and get down with some DIY”, says Melvær.
See the final result at http://www.elektroavdelingen.no/.
Projects
- Accordion (jQuery)
- Airport (jQuery)
- Defaultvalue (jQuery)
- Elastic (jQuery)
- Highlight (jQuery)
- Keycan
- Lazy (jQuery)
- Limit (jQuery)
- Password Strength (jQuery)
- Show Password (jQuery)
- Tabify (jQuery)
- Valid8 (jQuery)
Latest posts
- July 8th, 2009 Why are we typing passwords twice?
- July 5th, 2009 Don’t stop password masking; let the user decide
- June 1st, 2009 You can’t validate email addresses with regular expressions
- May 20th, 2009 Konami Code: Why so verbose, when you can make it in 140 characters?
- May 18th, 2009 Let your users know if Firebug slows down your web page.