Posts

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

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

19 June, 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()

16 May, 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

16 April, 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

06 February, 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

17 January, 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…

Using the 'posts_where' Filter with WP_Query in WordPress

25 April, 2018

If you’ve spent 20 seconds in WordPress development, you’ve likely worked with, cursed, and fallen in love with the WP_Query class — one of the most useful, commonly used tools in any given WordPress website or application.Aside from being…

Preloading JavaScript Assets in WordPress

05 April, 2018

Squeezing every last drop of performance out of your website on any platform is an always-changing, never-ending, often addictive battle.Among the several tactics you can employ in this fight, optimizing your site’s resource hints is a modern…

Creating the Simplest WordPress Plugin

04 April, 2018

If you’re making modifications to the functionality of your WordPress site or application, there are generally two places where people put the code to do it.A theme’s functions.php file. A plugin.Given the choice, which option should you almost…

Let's Stop Making it Cool to Hate jQuery

19 March, 2018

When I started web development, beginning a new project often felt like drowning and then being asked to write JavaScript that worked. At the time, all I needed to do was perform some DOM stuff: make an element disappear on a click, add some classes…

Build Your Own Simple Lazy Loading Functionality in WordPress

23 February, 2018

When you’re looking to incorporate any given feature into your WordPress application, there’s rarely a shortage of third-party plugins out there to make it happen. But sometimes, whether you’re trying to avoid the inevitable complexity an unfamiliar…

Building a Lambda Function with Netlify

12 February, 2018

A while back, I wrote my first Lambda function with Firebase. Like every Lambda function tutorial on the web shows you how to do, mine processes a payment via Stripe when someone purchases a license for TypeIt, the most versatile JavaScript…

Removing Usernames from Password Reset URLs in WooCommerce

05 February, 2018

Securely handling personal information on the web is a pretty big deal, and one of the ways you do that is making sure none of it’s sent via query string in a URL. Things like this are bad:In fact, Google has some clear policies explicitly…

Using the Negation Pseudo-Class to Select Elements with No Class

24 January, 2018

If you’ve been a developer for more than 7 minutes, you’ve probably felt uncomfortably pressured into doing something weird with your code, like specifically styling plain, classless, attribute-less elements. Don’t ask for the details, just accept…