My wife is away for the week, so this mope has to put up with me as a substitute for her favorite person.
Blog
page 2Programming, Tutorials
Build a Modern GraphQL API with Prisma
Learn to use Prisma, a powerful, type-safe ORM to build a modern GraphQL API in this new course by Ryan at Level Up Tutorials
September 30, 2021
I’m starting to realize about myself that I’d rather have something personal, nostalgic, or imbued with special meaning, than something that looks perfect or perfectly matches my taste. Sally made this when she was a kid, in some shop class or other. Not great craftsmanship, not great materials, not even a particularly interesting design. I could have bought myself something prettier, nicer, and more functional to serve this purpose. But I never even more than briefly considered it. I’d rather have this.
June 28, 2021
Programming, Tutorials
Run this AppleScript to Hear your Music in Glorious Mono
I often work while my son is sleeping or napping. My desk is right outside his room, so if I want to listen to music, I need to use headphones. But I'm also often the primary caregiver at the moment and need to keep one ear open so I can hear if he needs something, which means if I want to listen to music I need to use head*phone*.
December 8, 2020
Programming, Tutorials
Save 20 Minutes Every Time with this Complete NextJS Config
By the time you've finished this guide, you'll have a repo you can clone every time you start a new project. You can skip all that swearing and hair-pulling and get right down to coding.
October 27, 2020
Programming, Tutorials
Async Data-Fetching Sandbox
I recently needed to mock a very basic generic asynchronous data-fetching API with loading state in order to create a GitHub issue. I have a feeling it’ll be useful later, possibly even to other people, so here it is:
https://codesandbox.io/s/async-data-update-starter-xf3oq
It uses a promisified wrapper around localStorage
, with timeouts to simulate the async data-fetching, and local React state for loading
, because my original use case for it was simulating a common pattern with the Apollo client. (But this should work for other kinds of async data-fetching.) It doesn’t really do much out of the box other than render a stringified version of the original data; even the data-update handler is commented out. Wire up however makes sense for you.
September 3, 2020
Programming, Tutorials
How to Patch an npm Package with `yarn patch`
One of the new features of yarn 2.0 is the ability to modify an installed package in-place, so you can incorporate your own changes or bugfixes without having to wait for the package maintainer to make those changes—or, indeed, so you can make changes you think the maintainer will not make at all.
September 2, 2020
Programming
Comments for Now You
There’s a programming joke about comments I heard a few years ago, kind of forgot, and can’t find now. It goes something like this:
Newbie Dev: Lol comments r dumb
Junior Dev: Comments explain what you did for other devs later
Mid-Level Dev: Comments explain why you did it for other devs later
Senior Dev: Comments explain why you did it for you later
I’ve always mentally added my own1:
Galaxy2 Dev: Comments explain what I’m doing right now
Not all that often, but sometimes, I’ll be banging my head against some intricate problem (it almost always seems to involve multiple JS Array.prototype.reduce
s for some reason), and eventually start to suspect that I’m mentally glossing over some aspect of the solution that isn’t making it into the code, or is poorly implemented, because I haven’t explicitly understood it to even be a problem. So I write a comment explaining to, ostensibly, a future me or future dev, but really to present me, explaining exactly what the program is intended to do. Then I write the implementation of the comment. This invariably gets me at least one step closer to the solution.
August 26, 2020