Thoughts, explanations, and musings, usually on web development.

Building a Shell Function to Copy the Latest Git Commit SHA

August 29, 2019

Frequently enough, I find myself needing to copy the SHA of the latest commit in project, and doing it manually was becoming a chore. I’d been getting more comfortable and excited about improving efficiency by rolling custom shell functions (like I…

Should We All Start Implementing Differential Serving?

August 22, 2019

There’s been a lot of discussion around the potential to serve browsers the JavaScript bundles they can support. For example, if a user’s on Internet Explorer, serve a transpiled, polyfilled bundle. If they’re on a modern version of Chrome, deliver…

Deploying Code with a Git Hook on a DigitalOcean Droplet

August 19, 2019

I’ve been working on a project involving long-running, resource-intensive batch jobs in Node. At first, when my needs were simpler, I used Heroku to run these jobs. It was great, but eventually, the price:performance ratio offered became a little too…

A Simpler Unit Testing Setup for WordPress

July 24, 2019

When I was getting started in web development, I remember how conceptually overwhelming it was to understand the whys, whats, and hows around things like unit testing. And to make it even more difficult, WordPress was the environment in which I spent…

Creating a .map() Method for Objects, Strings, Sets, and Maps

June 19, 2019

It’s a well-established truth of the universe that JavaScript’s is one of the best parts of the language, allowing us to write cleaner, simpler code to manipulate array values, instead of using something like . For example, let’s say we want to…

Remember to Probably Target an Empty Object with Object.assign()

May 16, 2019

Hearken back, for a moment, to what it was like merging objects in 2014. There was no support for the feature in JavaScript runtimes themselves, and it was quite common to find a solution to the problem by wading through StackOverflow to find…

Formatting My PHP More Efficiently with a Bash Function

April 16, 2019

For quite some time now, I’ve been working with a PHP application that, up until recently, had no clearly-defined coding standards in place. At some point, the decision was made to enforce PSR-2, and to do so at an incremental level. When a file is…

Quickly Spin Up MySQL w/ Docker Compose

February 06, 2019

I’ve often needed to quickly spin up a local instance of MySQL. Docker Compose this makes it stupid easy. Rather than running a long, convoluted command, I can configure an image just the way I want it while maintaining the ability to turn it easily…

Writing a Regular Expression to Target Images Without a Class

January 17, 2019

A while back, I wrote about building your own lazy loading functionality into WordPress. In that post, I use a regular expression to add a class to image tags that don’t already have any class. It failed. Rather than adding it to images with no…

© Alex MacArthur | 2020