Posts relating to

Inlining CSS – the Good, the Bad and the Ugly

I’m a sucker for performance gains to the point that I’m convinced I’m actually losing time overthinking it – 🤔 A good example is CSS delivery and it’s always interesting to get others’ opinions on how important they consider styling performance to be and how they measure it. Inlining – good/bad/ugly? Good I see genuine […]

Updating Macs on Mojave to run VirtualBox

We use VirtualBox for the local development of websites, this article walks through the process of updating it to at least 5.2.22. Why update VirtualBox? Simple: Older versions of VirtualBox will not be compatible with macOS Mojave. The simple fix Grab the latest version of VirtualBox, install it and you’re! Conclusion As we use VirutalBox […]

How to trim words by character limit

We recently encountered a scenario where the client wanted to trim the news items titles to a maximum number of characters, whilst respecting words. Our research revealed that this seemingly obvious requirement wasn’t elegantly solved. As most of you will know, there are solutions for trimming by characters or trimming by words, but neither of […]

Use PHP’s in_array() to compare a variable to multiple values

When comparing a variable with multiple values consider using in_array(), instead of complex if expressions. I love clean, easy-to-read code, which is why I am not a fan of if statements with complex expressions. For example, consider the following snippet, which is checking a variable against several values: if ($test_variable === ‘value1’ || $test_variable === […]

How to fix macOS usr/local is not writable

This simple post should fix the “usr/local is not writable” issue with homebrew. Whilst on holiday I needed to use an old MacBook to crack on with some work. In order to do so I had to install the latest version of ansible, but encountered the permissions error “usr/local is not writable”. I found uninstalling […]

How to call wp_get_attachment_image() without srcset

Sometimes it’s nice to have all the goodies wrapped up in a nice little function, such as wp_get_attachment_image(). This is a great function that generates the entire html for an image tag, including srcset and sizes. However, wouldn’t it be great if sometimes we could get all the goodness from this wonderful function, but just […]