If you ever played any platform, fighting or combat games like Contra or Mortal Combat, then you will be familiar with the special key combinations for executions or special attacks that gives you some extra power, effect, or god mode. The Konami code was one of the fist cheat code in the video gaming history, that special combination later adapted by many games.
In the age of websites, many sites also installed small easter eggs for their visitors, just for fun. See the list here.
I played a little with implementing it, and just a few rows were enough to achieve the desired effect.
var p = 0;
var order = [38,38,40,40,37,39,37,39,66,65];
document.onkeyup = function(e)
{
var key = (window.event) ? event.keyCode : e.keyCode;
p = (order[p] == key) ? ++p : 0;
if( p == order.length ) alert('Boom, secrets unlocked');
};
Last day I had to hack a webshop's basket management system, and deleting the items had to be done via AJAX. The problem was, that each call had to wait the previous to be completed, otherwise some products kept in the session. The solution was simple: call the AJAX requests recursively on the 'onComplete' event.
Here is a cleaned up code, using MooTools 1.2.4. Call addAjaxParam() to prepare the ajaxParams array.
var ajaxParams = [];
function addAjaxParam( pid )
{
var obj = {
'option': 'module_shop_action',
'product_id': pid
}
ajaxParams.push( obj );
}
I'm a little bit lazy and I prefer the challenging parts of coding, not the boring, repetitive ones. I read somewhere that a great percentage of development time is spent on creating basic CRUD functionality. I had to find something to get rid of this, so I did a little research on which is the best tool for PHP to generate CRUD source code.
Since I was using CodeIgniter for a while, I searched the forums for CRUD solutions and I found this forum thread. After downloading the package, I instantly loved the idea, that you can generate CRUD code based on source code templates. Just a click and models, views, controllers are ready to use, customized for your database schema.
Although the 1.1 is really cool, I missed a lot of features, that I added later.
10
Read more
All rights reserved, ©2008-2010 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1