How to install PEAR (Linux)
PEAR (PHP Extension and Application Repository) is a bunch of extensions you can install on your server to uitilise clever ‘extras’ that other people have spent their time writing. To…
Editing massive files on Windows
I you need to edit a MySQL dump which is 2.5Gb and you are unfortunately running Windows, I’ve found a cracking application called PilotEdit which will open files larger than…
Absolute positioning within another container
Say you want to position something within its container, then the element you are trying to position needs to have: position: absolute; But the parent container can simply have: position:…
Custom Zend Validator error messages
The Zend Validator error messages are not the most helpful. Considor the below code for creating a file input: $this->addElement('file', 'signature', array( 'validators' => array( array('Size', false, 20480), //20k array('Extension',…
PHP Create a ZIP file
I was just playing around with PHP’s ability to create compressed files, and I had a problem. My ZIP file was not getting created but I wasn’t getting any errors.…
Netbeans – Goto matching brace/bracket
If using Netbeans for your development and you have a horrendous spagetti coded “if” statement, you can use a keyboard shortcut to go to the matching opening or closing bracket.…
Preventing pesky consoles. (forgetful developers)
I always end up leaving debug code in my pages for one reason or another. One of which is console.log() for the firebug extension. Now, if you leave this and…
JavaScript – Use a variable for a function call
Sometimes you want to pass a function around from script to script as a string containing the function name (well maybe not, but I have some legacy code that does…
What is database sharding?
Databases, by their own nature, become large beasts. This is a fact of life and whilst a lot of databases don’t encroach on “unusable” sizes, some do. There is a…
Using mod_rewrite for clean URLs
Say your message board on your blog uses the following request URL to find and display the correct data: http://www.mysite.com/blog/index.php?category=news&year=2012&month=1 This is a rather simple request, but it is not…