Archive for October, 2009

It seems that you can’t submit a form with jQuery using:
1$(’form#myform’).submit();
If you have an input in the form with the name attribute set to submit. So this doesn’t work:
1<input type="submit" name="submit" value="Press to continue" />
Change the name attribute to something else other than submit and it works fine ;]

This is quite a handy method for your tools class. It will split camelcase strings up nicely. You could then explode if necessary:
123456static function splitByCaps($string){
    return preg_replace(’/[A-Z]/’, ‘ $0′, $string);
}

Tools::splitByCaps(’HelloWorld’);
#Will return ‘Hello World’

I managed to recompile PHP with some new directives and install it on my live production server with minimal downtime.
I followed these steps:
1) Downloaded the source of PHP. I stuck to the same branch (5.2) as there was nothing I required in 5.3.
2) Backed up my /etc/php.ini file.
3) Compiled PHP with ./configure using my old [...]

God I hate IE6! The day it’s finally laid to rest will be party day at my place. Everyone is invited!
This is probably an oldie but I came across it for the first time today.
I had some elements that were invisible in IE6. Only until I selected them by mousing over and left clicking.
I managed [...]

You can return the exit/return code of the command you just ran in OSX/Linux using this simple command:
1echo $?
This is handy when debugging scripts that rely on shell command return values.

You can use this in your MySQL WHERE clause to return records that were created within the last 7 days/week:
1created >= DATE_SUB(CURDATE(),INTERVAL 7 day)
You can also use NOW() in the subtraction to give hh:mm:ss resolution. So to return records created exactly (to the second) within the last 24hrs, you could do:
1created >= DATE_SUB(NOW(),INTERVAL 1 day)

If you want to view changed/modified/added files from previous revisions with SVN you can do this:
12svn log -v -r 25
# This will show you the changes that were committed in v25


top