Skip to main content

Why is date formatting so hard in vanilla JS?

· 2 min read

Editor's note: this was written before the new, long-overdue Temporal API was announced. Better days are almost here!

Suppose you want to deal with some dates while building a website. You don't want to roll your own input parsing, so you use new Date(inputDateString); and you want to output datestrings in a format that's clear, readable[^1], and (while we're making a wish list) sorts the same both lexically and chronologically. That is: you want YYYY-MM-DD. Surely that is built in, right?

wrong

Oh. Wait, really? Ugh, fine.

Rewriting a middleman site with gatsby

· 8 min read

It came to pass that after 3 years of neglect, I wanted to revive my old website. I figured I'd add a post or two, maybe tweak a few things about the HTML and CSS, and then I could rewrite it in a different stack at my leisure. I think a lot of things that are wrong, though.

Why emacs is worth the bother

· 13 min read

Emacs has a few unusual properties which work together really well, making for a super powerful, flexible system that's easier to bend to your will in sophisticated ways than almost anything else around. That might sound like a lot of work, but most day-to-day emacs usage isn't reinventing the world; when you want to do something custom, though, the power is right at your fingertips. Literally.

Zero-friction testing in rails

· 7 min read

AUTHOR'S NOTE: this post is several years old, but it's a fun time capsule. Professionally I was but a babe, and had just left one of my first programming jobs, where I had encountered my first truly heinous codebase. I was almost comically thirsty for quality and blessed with a project that was conceptually reducible to a pure function. Nonetheless, what is describes remains my favorite programming workflow: in a split terminal window, running a text editor on one side, with a unit test watcher on the other side giving immediate feedback when files change.

So. It wasn't until a few months ago that I finally worked on a software project with full test coverage. Now that I have, I'm a little shocked and horrified it took this long: the quality of life is drastically better on this side. The project in question is RIO, an ES6 legal citation parser I've been building for Cornell Law's LII. I've been developing that solo, so I had the liberty of setting the testing mantle up to suit my own workflow: heavily terminal-based, using vim and tmux.

Building An Adequate Wedding Gallery

· 5 min read

A Cool-ass photo album

Our wedding photographer was a little slow in getting us our images, so I got to thinking about what to do. I decided I wanted a static image gallery, and I wanted it to be easy for anyone who came to get copies of photos they like, whether for online use or making prints. For prints, people should be able to download the high-resolution originals, and those are such big files, it makes sense to zip the files before downloading. For digital use, there should be smaller image files for download[^1], but that could easily be handled entirely client-side.

I decided that, in addition to normal "download this photo" usage, I wanted the ability to

  1. Select any given subset of the images easily; and
  2. Download that set of images as a zip file

This is a kinda fun UI problem AND has a fun backend problem despite dealing with static data. Which is great: since we're not barring our photos from anyone, there's no need to implement any auth, which cuts out a big, common hassle right from the get-go.

Cron: Legacy

· 8 min read

I thought it would be cool to get my computer to automatically run brew update every so often in the background and email me if anything went wrong. I thought it would be pretty simple! It was not, in fact, prety simple: I ran into a bunch of super frustrating errors, usually because I was taking some aspect of my normal terminal environment for granted (the $PATH variable that tells the shell where to look to find commands; email protocols and authentication; ssh authentication; error handling in the shell; etc etc etc).

But I learned a bunch in the process! So kick back, pour yourself a drink, and learn about cron, the old-school unix tool you can use to run programs behind your own back.

What Does It Even Mean For The Media To Be Objective

· 7 min read

This is a timely and important article, and it drove me absolutely crazy. Before I quote anything, I think I need to do some conceptual prep work. The problem, you see, is that the article suffers from a fatal fault—in calling out a false notion of objectivity, it leaves unquestioned its right to be framed as "objectivity". Look, I know I might sound ridiculous, but goddamn it, ideas matter. It's not so much a problem because that false objectivity is bad per se (though it is); it's a problem because a better alternative exists and I think getting it right is really, really important.

Locks Are Some Shit

· 9 min read

I've been reading Operating Systems: Three Easy Pieces. I highly recommend the book if you're cool fiddling with C a bit. Actually, scratch that: I recommend the book if you ever write code that runs on a server or any other linux/osx environment, especially if you feel a little out of your depth with C. The code examples are not that intimidating, even if you don't know from typecasting or a pointer (okay, learning the difference between foo, *foo and &foo is useful, but not knowing it doesn't prevent you from getting the gist of the code samples), and getting a deeper understanding of the environment your code works in will make a lot of known unknowns come into a bit more focus. Honest.