It is possible to make no mistakes and lose.
That is not failure; that is life.

– Captain Jean-Luc Picard, Star Trek

Earth Temperature Timeline

The earth is always in a constant state of temperature change. This has been true since long before humans were here, and will continue long after we are gone. The question of the last couple generations has been; Are Humans causing an above average temperature shift?

XKCD, one of my favourite online comics, has done an excellent graphic detailing the comparative shift of temperature in the planet. This graph clearly outlines how the planet has gone through minor temperature fluctuations in years past, but is accelerating exponentially now.

I would like to note that I have NOT verified any of the data that XKCD has used to make their graph, so I can not confirm it’s accuracy. Given the scientific depth that XKCD usually uses to make their comics, I tend to lean on the side of believing their interpretation of the data. Of course, I invite you to verify the data yourself.

Direct Link

Design Better Forms

There are some great tips in here. My favourite is about displaying select lists, with less then six items, all inline. I’ll have to look at some of my own forms to do this. I would love to see someone make a Gravity Forms plugin for this!

If you want to know what a man’s like, take a good look how he treats his inferiors, not his equals

– Sirius Black, Harry Potter

Use PHP to Retrieve All Links on a Page

I was developing a project recently, where I had the need to get all the links on a certain page. I first turned to a JavaScript library, like Jasmine.

I really wanted to do this within my PHP code, so I ended up going with this solution:


$html = file_get_contents('http://www.example.com');

$dom = new DOMDocument();
@$dom->loadHTML($html);

// grab all the on the page
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");

for ($i = 0; $i < $hrefs->length; $i++) {
    $href = $hrefs->item($i);
    $url = $href->getAttribute('href');
    echo $url;
}