Writing

Tutorials, thoughts.
2025
2024

Sass support in Eleventy

Enabling the Eleventy build process to handle Sass stylesheets isn't too difficult, but I couldn't find one place that documented all the moving pieces you need in your Eleventy config for (what I consider) a production-ready implementation.

Oct 2024
static sitesasscss

SCSS Random Values

It’s nice for app & site designs to have a little variability. Uneveness used with care can communicate a handmade feeling, for example slight waviness instead of perfectly regular lines in a diagram makes it look hand drawn.

May 2024
cssdesign
2023

Building a Rehype Plugin

I was recently in the process of fixing syntax highlighting on this blog and found I was missing some important tools.

Nov 2023
next.jsrehype

A/B Testing Won't Make Your Org Data-Driven

When comparing A/B testing products you'll see claims in marketing material that A/B testing will enable or enhance "data-driven decision making" in your organization.

Oct 2023
A/B testingbest practices
2022

State Machines in React

The "state machine" programming pattern is a great way to refactor code with lots of nested conditionals.

Feb 2022
reactprogramming patterns
2020
2019

Hidden Color Functions in THREE.js

THREE.js' ShaderMaterial lets you write your own shader code, but still leverage all the great boilerplate that THREE.js uses internally for its other materials (like StandardMaterial). Pretty neat!

Nov 2019
webglthree.jsgraphics
2018

Hashing assets when server-side rendering

Webpack can generate hashes for every bundle that it outputs. If you use that hash in your bundle filenames, it gives you a way to safely serve your bundles with long-term cache headers.

Jun 2018
seobest practices

Convert integers to binary strings

If you want to visualize the binary digits of a number in JavaScript, you need to decode the floating point format as you build your string.

Apr 2018
data structures
2016

Syncing code with the sun

setInterval() and requestAnimationFrame() both let you call some piece of Javascript on a regular interval. In both, the elapsed time is relative to when your script first starts executing. Let's look at how you can keep your code in sync with a wall clock instead.

Jul 2016
schedulinggame development

Mutating a hierarchical array in PHP

Reading JSON-formatted configuration files into PHP can be a headache, especially when you need to populate default values.

Jun 2016
data structures

Default options - avoid boolean OR

A common pattern in Javascript is the use of options objects to pass multiple parameters to a function. There's a particular pitfall in how people often implement this useful pattern.

Apr 2016
idioms
2015