Accessing the Zend_Application from a page
If, like me, you need to access some Zend_Application resources (such as multidb resources) – then you need a reference to the Zend_Application and the bootstrap. I use this: if (null == $this->_application) { $this->_application = Zend_Controller_Front::getInstance() ->getParam(‘bootstrap’); }
Online regex -> php tool
I’ve found an excellent online tool, where you can give it a regex, and it will spit out the PHP syntax for use with preg_replace, preg_match, etc. I’m forever getting ‘Unknown modifier’ errors when trying to insert regex’s into my PHP code. This sorts it out for you. http://regex.larsolavtorvik.com/
Remove svn folders from Ubuntu
When backing up a source code working copy, you don’t always want all the little .svn folders everywhere. You can “export” the working copy, or if you forgot, you have remove them all. Change the the folder containing the working copy (this is very important*) cd /home/username/www/sitename/ And then remove them all, recursively with this [...]
Regex – “The” searching
Say you have a list of movie titles, and you want to either sort them, or search through them, and some of them have “The ” at the start, for example: The Simpsons Simpson Street When doing a MySQL search: SELECT * FROM movies WHERE title LIKE “The Simp%”; Would only return the first row. [...]
« go back