Python patterns I learned during last year's Advent of Code: Python is a great fit for Advent of Code style problems. Here are a few patterns I picked up that I'm going to try and use again this year. 2024-11-13

Indexes are sorted arrays (sort of): Thinking of B-trees and B+-trees as sorted arrays can help you reason about indexes and performance. 2023-08-14

JSDoc comments can make fixtures easier to work with: By auto-generating JSDoc comments on a fixture IDs file, we were able to make our fixture code simpler to work with. 2023-07-23

So, what can you do with a process ID?: If you have a process ID, you can look at what files/ports a process has open, see details about how the process was started, trace it to see what work it's doing, or wait for it to complete its work. Process IDs are pretty cool! 2022-12-10

Why does zip(*[iter(s)]*n) chunk s into n chunks in Python?: Understanding why zip(*[iter(s)]*n) chunks an input s into n chunks is a good excuse to explore iterators, iterable unpacking, list multiplication, and the zip function. 2022-12-10

Culling Containers with a Leaky Bucket: Containers serving production traffic can sometimes get into bad states that they can't recover from. Automatically shutting down these problem containers can make production systems more resilient until you're able to debug and fix whatever the root cause is. 2022-10-24

Writing FizzBuzz in MySQL 5.7 for no good reason: MySQL 5.7 makes getting a list of numbers pretty tricky, so solutions to FizzBuzz are a fun chance to explore MySQL techniques like session variables, stored routines, and cross-joined views. 2022-07-07

Using NodeJS's AsyncLocalStorage to Instrument a Webserver: How to start an async storage context early in your middleware stack and set up counters to track down problem routes. 2022-05-30

Large Analytics SQL Queries are a Code Smell: Large analytics SQL queries can be unmaintainable and hard to debug. Writing large SQL queries is hard and slow! You can use temporary tables and views to break down those queries into smaller pieces that are easier to work with. 2022-05-11

Shell Patterns for Easy Automated Code Migrations: Being comfortable using shell tools to do large code migrations is a superpower. Here are the patterns and techniques I find myself using often. 2022-05-11

Red and Blue Function Mistakes in JavaScript: Use of async functions in JS leads to consistent mistakes: these are the ones I see most often. 2022-03-25

Slack is the Worst Info-Radiator: Remote teams need a way to replace the in-office info-radiators that displayed info about the health of our system. Alert slack channels are often too noisy to be useful and don't display the current state of the world well. 2021-12-06

Bash Patterns I Use Weekly: 5 bash tricks I find myself using often that I wish I'd discovered sooner. 2021-11-22

Clean SQL Tricks: SQL queries can be much simpler to write, understand, and maintain if you create temporary tables, use SELECT without FROM to test out behavior, have an easy way of accessing constants, and test your queries as you go. 2021-11-20

Canary Containers at ClassDojo in Too Much Detail: ClassDojo sends real traffic to canary containers to validate new builds and uses that as part of a system that safely deploys new code multiple times a day. 2021-11-02

Mongo Performance is Disk-graceful: MongoDB databases often require lots of disk I/O because documents aren't stored in a clustered index and because writing snapshots can saturate disk I/O. 2021-10-22

AsyncLocalStorage Makes the Commons Legible: Node's AsyncLocalStorage can dramatically increase monolith legibility and improve performance. 2021-08-18

The 3 things I didn't understand about TypeScript: understanding type inference, type narrowing, and structural typing is crucial to writing good TypeScript code. 2021-08-10

Manipulating text and files solves problems: Many programming tasks can be solved with tools that manipulate text & files. Shell tools are a good fit for these tasks, but if you don't know shell tools, you can use any other programming language to accomplish the same things. 2021-08-01

HyperLogLog-orrhea: how do HyperLogsLogs work?: HyperLogLogs leverage the power of hashing strings into random numbers to create remarkably accurate cardinality estimates. 2021-07-14

ERROR, WARN, and INFO aren't actionable logging levels: Logs should be actionable and the default categories of FATAL, ERROR, WARN, INFO, and DEBUG aren't precise enough. 2021-07-13

Graceful web-server shutdowns behind HAProxy: Graceful shutdowns behind a load balancer are hard to do right, but they enable solid auto-scaling and safe frequent deploys. 2021-07-12