Super-charge your WordPress Blog: Setup a CDN

Performance is important. We get this. As blog owners if our users get frustrated then we get frustrated. In this post we’ll look at how you can move a blog’s performance and loading times to the next level. A couple of years ago we looked at how to improve a website’s loading times – this post should be more specific than that, focusing primarily on WordPress and how content is delivered to your users. Who is this article for? This … Continued


9 Things I Wish I’d Known about PHP Years Ago

I have been working with PHP for a good number of years now – (not including WordPress development, does that count? 😉 ). Here are some of the things I wish I’d known at the very beginning. Most of them are small little code snippets but there are also a few points about diving into the code too deep. Towards the end are a few helpful resources which have helped me out along the way. Coding: 1. Array Manipulation Since … Continued


Detecting if a User is on a Touch Screen Device in JS

Whilst recently working with native date pickers on mobile browsers, Chrome and Opera we came across an issue. The native datepicker wasn’t acting as we wanted – but we had no control over it (you can’t trigger a native datepicker to open in Chrome!). Because of this we wanted to fallback to a custom date picker (think jQuery UI) if a native date picker didn’t exist or if the browser is on a desktop. We’ll focus on the ‘is on … Continued


Validate a UK Grid Reference in Laravel 5

This will just be a small article and quite a specific one. We’ll be looking at how to verify an input to guarantee it is a valid 8 figure grid reference. This will be checking against the UK Ordnance Survey standard, so two letters followed by four easting numbers and four northing numbers. e.g. AA11112222 It is important to remove any spaces from the string before submitting. This can be achieved through a small JS function and a .replace function. … Continued


Create your own Exception Handler in PHP

If you’re used to writing your own PHP applications, you will no doubt be used to having to deal with exceptions being thrown at awkward moments. Resulting in a ugly 500 error being shown to the user and no extra direct from them to take. Luckily we can choose our own way of handling these exceptions, showing a better message or logging the error more efficiently. In an ideal world, we wouldn’t need these as everything would work perfectly, all … Continued


Direct Upload to S3 (using AWS Signature v4 & PHP)

The contents of this article has been replaced by a PHP Composer package, hope you find it useful.   View on Github This article is specifically about directly uploading files to S3 using the AWS Signature Version 4, which is mandatory for new S3 regions, like Frankfurt (EU). It will also become required on other regions at some point as Amazon migrate over, so it’s recommended to use this method where ever possible. For more info, you can read about … Continued


A Week with Laravel 5: What’s New

With a PHP project we have just started, we decided to begin development with the Laravel 5 framework – even before it’s been released. The framework is due to be released this month (Jan 2015) and instead of starting with Laravel 4 and attempting to migrate upwards, it seems natural to begin with the newest version even though it’s features might change slightly pre-release. Being comfortable developing with both PHP and Laravel 4, some of the changes with version 5 … Continued


How to: Enable Web Components in Firefox (Shadow DOM)

Web components, sometimes mixed up with the Shadow DOM, are now available in Firefox v29+ under this flag – but they won’t be available to the average end-user. How to Enable: In your address bar, go to: about:config Search for the property: dom.webcomponents.enabled and mark it as true. If your already on a development page, remember to reload it. Further Reading http://css-tricks.com/modular-future-web-components/ http://oliversmith.io/technology/2012/05/19/inspecting-the-shadow-dom-in-google-chrome-inspector/ http://soledadpenades.com/2014/01/02/shadow-dom-in-firefox/


How to: Asynchronous PHP

Over the Christmas period I had a play around with getting PHP to run code asynchronously (not as easy as it sounds). When you have code, like API calls, which take anywhere near to a second to complete it drastically adds to the loading times of your pages. One easy solution for web apps is to only call the back-end PHP using AJAX. This means the page doesn’t hang and reload, things can happen concurrently and quickly. This solution isn’t … Continued



Load HTML once with AJAX

While working on a project recently, a dynamically loaded section was needed. It was used in a transition between step one and two in the user’s journey, after an API call had been made. The user was allowed to go back to step one at any time, resulting in a new API call – which was to be expected – but the call to get the HTML for step two was also made again. The same HTML which had just … Continued


Codename Sandcastle has Arrived

First there was Oceanic, then Waves and now it’s Sandcastle. Designed by a Turtle now has a new look after another year of active development. (Hopefully the name and images can remind us of the sunny times). The New Design The new design supports an edgy-look, sharp edges and bright colours and hopefully brings what’s important most (the content) to life. Technically Front-end development for this theme used Grunt and Bower for the first time to help manage third-party CSS … Continued