Category → Programming RSS
Converting seconds into a readable format in Perl
Here is a short and easy Perl function to convert the difference between two time stamps, into something that is more human readable. There are Perl modules that can do this as well, however I thought I would share what I wrote incase someone finds it useful. Read more →
Title case names in perl
While I was at work today I came across a script I wrote a couple of years ago to title case names in perl. This script will transform names to a nice, readable title case equivalent. E.g. "JOHN SMITH" to "John Smith", "JOHN O'BRIAN" to "John O'Brian" and "JOHN MCCOOL" to "John McCool" etc. Read more →
Dynamically set network location in Mac OS X
I love macs, but sometimes things could have been implemented better. In particular, I hate having to set the network location on my laptop when I go between work and home every day. I have put together a small shell script which can do this. I run this script on startup and it just checks what day and time it is so it can switch between two profiles (work or home). Read more →
PHP: Explore your server through a PHP file browser
In the past I've had to delete files from my server where the file permissions were set to apache and I could not override them because the host did not alllow terminal or shell access. So I quickly put together a PHP script that allowed me to navigate through the file system and unlink (or delete) files as the apache user. I haven't had to use the script for a while but I still think its pretty nifty to use when you want to explore a servers file system. Read more →
Sockets problem with MySQL/PHP and Mac OS X
After installing MySQL 5 on OS X 10.4, you may have noticed that the install package has placed 'mysql.sock' in '/tmp/mysql.sock' instead of '/var/mysql/mysql.sock'. This will cause the following error when you attempt to access MySQL through PHP: Read more →
PHP: Sending HTML Emails
Just like the general nature of PHP, the PHP mailing functions are simple to use as well. The easiest way to send an email is to use the mail function built into PHP 3, PHP 4 and PHP 5. However, to send HTML based emails (or any other content-type for that matter), you will need to alter the header values of the email. The following is a short example on how to do this with PHP. Read more →
Commenting is still enabled on these entries, so feel free to leave me a message.