Chris Tate-Davies

An archive of helpful tit bits of information for development, and probably some stuff that is incomplete, wrong or boring…

Linux – Viewing Processes and Process Threads

If you need to know about viewing processes on Linux, then there is an excellent page here: http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/ I shan’t steal all the information as its very nicely laid out already.

Using custom sounds for iPhone SMS notification

I quickly go bored of the default iPhone SMS sounds. But its relatively easy to switch them to your own. I used the following apps to do this. www.zedge.net – for downloading a suitable replacement sound. iFile – for navigating through the iPhone file system. You can also use iPhoneExplorer too if you’re on Windows. [...]

Setting up postfix on Ubuntu for mailing from PHP

To allow your Ubuntu server to send emails from PHP, then you need to install postfix. Postfix is a mailer for *nix platforms. So, to install it: sudo apt-get install postfix When this is installing, you’ll need to enter some options, like what sort of server you’re connecting to. I use my companies details in [...]

Sorting a SELECT with JQuery

Just a simple function to sort an already populated list. Obviously it would be easier to sort before populating, but there are the odd occasion where this is more complicated than you thought. Requirements : JQuery var selectOptions = $(“#selectId option”); Then, we just run the sort command on the options array – and this [...]

Zend_Date – difference between 2 dates

I keep having trouble with this simple calculation! So, here is a little example to get the amount of days between now and the next occurance of July 1st. //set up the 2 date objects $now = new Zend_Date(); $next = new Zend_Date(); //we want July 1st $next->setDay(1)->setMonth(7); //if we are currently after july this [...]

Piwik – open source alternative to Google Analytics

Google Analytics vs Piwik

ThreadSMS – Review

My Nokia doesn’t have threaded SMS view – and its very annoying. So, after searching about for a suitable application for this, I came across ThreadSMS by eHandySoft (http://ehandysoft.com/threadsms.htm) Functionality: Quick to load, and quick to navigate. On my N97 mini the scrolling was very smooth and precise. The threads are loaded with contact pictures [...]

Reading the MySQL binary log

Having MySQL dumping out binary logs is a very good failsafe for backup redundancy. But, how do you get any of the information out of them? If you know a time span that you need to investigate, then you can easily use the mysqlbinlog utility: mysqlbinlog –start-datetime=”2010-07-27 14:30:00″ –stop-datetime=”2010-07-27 15:00:00″ > backup.txt This will export [...]

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’); }

Retrieve email using regex

ThisĀ horrendousĀ regular expression will parse a string and return a valid email address from it. $email = “<’Freddy’> fred@live.com”; preg_match(‘/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/’, $email, $match); echo $match[0]; This will return: fred@live.com Basically, if you pass an array as the third parameter of the preg_match method, it will be filled with the preg_match results, and the first item of the [...]

« go backkeep looking »
  • Chris Tate-Davies

    Hello there. This is my little "repository" on the world wide web. Its for nothing more than documenting things that I might need again in the future. You could describe it as an extension to my memory.

    Also an online collaboration of my thoughts through the day. I'll try to keep the real random stuff out and keep the blog on course.

    Thanks for stopping by... Hope you find what you're looking for...

  • Tags