Archive for January, 2010

Validate Australian phone numbers in PHP

January 22nd, 2010

Here is a very basic PHP function to validate Australia phone (landline and mobile) numbers.

function validate_phone($number) {
	$number = preg_replace('/[^\d]/', '', $number);
	return preg_match('/^(0(2|3|4|7|8))?\d{8}$/', $number) 
		|| preg_match('/^1(3|8)00\d{6}$/', $number)
		|| preg_match('/^13\d{4}$/', $number);
}

Fixing Selenium typing errors in Firefox

January 20th, 2010

I recently updated our Selenium Remote Control (RC) testing tool to v1.0.1 so that we could test our site on Google Chrome (and, somewhat tentatively, IE8).  We have been using this tool with varying success for quite some time now, with our tests written in PHP. The update process was generally smooth but one annoying bug persisted – Selenium would no longer type the ‘y’ key in Firefox (2 and 3). As a result many of our tests broke simply because the input typed into a text box did not match what was intended.

» Read more: Fixing Selenium typing errors in Firefox

Triple J’s Hottest 100 2009 Song List Previews

January 6th, 2010

When it comes to voting for Triple J’s Hottest 100 I always struggle to think of the songs I want to vote for. I know the songs if I hear them, but can’t think of the artist or title in most cases. A really useful thing would be a list where I can see all the songs I can vote for, with a preview of each next to it.

I haven’t been able to find anything like this so far on the ‘net, so my friend, Tommy, and I went ahead and made one! This is a list of all songs you can vote for in the 2009 Hottest 100, along with a YouTube video preview of each one.

Check it out here: Hottest 100 Song List with Preview. Hope you like it!

iPhone Development

January 5th, 2010

Ok, so I’ve started learning how to make iPhone applications – exciting stuff! » Read more: iPhone Development