img

Hello, I'm a Senior php web developer who works with companies and individuals needing an effective online presence. I have over 9 years of experience working with PHP, JS, CSS and XML as well as a number of other languages and technologies.

News
A quick look at development related articles

2012-02-05
JavaScript Testing From Scratch: New on Premium
This likely isn’t the first tutorial on testing that you’ve ever seen. But perhaps you’ve had your doubts about testing, and never took the time to read them. After all, it can seem
more...

2012-02-02
Best of Tuts+ in January 2012
Each month, we bring together a selection of the best tutorials and articles from across the whole Tuts+ network. Whether you’d like to read the top posts from your favourite site, or would like
more...

2012-01-31
Learn jQuery in 30 Days
Sometimes, it’s easy to become overwhelmed by how much there is to learn in this industry. If jQuery happens to be on your personal “need to learn soon” list, then I’m happy to
more...

My Blog
Thoughts on what I do and updates on what I've done.

September 27th, 2011
So today I was on a phone interview where we were looking over some code I had written a while back but am presenting as example code. As we went through I was called out on what is probably a pretty rookie mistake.

Here is the code, see if you can find where I am wasting memory....
$i = 1;
foreach ($answers as $index=>$value) {
	$returnValues['answers'][$i]['id'] = $value['id'];
	$returnValues['answers'][$i]['answer'] = ucwords($value['answer']);
	$returnValues['answers'][$i]['correct'] = ucwords($value['correct']);
	$i++;
}
Well it turns out that rather than initiate var $i and increment it (using up precious space) I should have just used $index.
Now the flipside of this is that I did not want a zero indexed array and so I still would have had to add 1 to $i ($i+1) each time.
foreach ($answers as $index=>$value) {
	$nonZeroIndex = $index+1;
	$returnValues['answers'][$nonZeroIndex]['id'] = ...  
             
            Read more...
        
September 27th, 2011
Just finished implementation of the Sidecar analytics program into the ecommerce platform for eFashionSolutions.

Sidecar is a real time web analytics service. This means that when you login and view your stats, you are seeing up to the minute data on the traffic to your web site. Most services don't let you see what's happening "today" until the day after.

Real time data lets you react to changes in your traffic as they occur. For example, if you had an article that hit the front page of a popular site like digg.com, you would see the traffic spike in Sidecar immediately, along with links back to the sources sending you the traffic. Knowing this, you could make changes to your site or to the article itself to take advantage of the situation.

If instead you relied solely on a service like Google Analytics, it would be up to 24 hours before you even knew about the ...   Read more...
Page
1