Welcome!
My repository of things I've learned. Mostly programming related. Part microblog, part knowledge base, part digital garden. If you like this, you might enjoy my blog.
55 TILs so far!
Recent TILs
- prosemirror Prevent extra whitespace in NodeViews
While trying to build a ProseMirror
NodeView
using a Shoelace dropdown, I kept getting a ton of extra vertical space around the dropdown trigger. - django Conditionally extend a template
Django supports template inheritance via the
extends
tag. Often, a template inheritance chain follows all the way up to a "base" template that contains the full markup for a page, from the doctype to the closing HTML tag. - prosemirror Use a Svelte component as a NodeView
The ProseMirror rich text editor library has a concept called
NodeView
for rendering custom widgets with a document. - svelte Force reactive state to reevaluate
In Svelte 5, you declare a reactive variable using the
$state
rune. - git Ignore all .DS_Store files
If you use git on a Mac, chances are you've accidentally committed a
.DS_Store
to a repo. I used to reflexively add.DS_Store
to all my.gitignore
files to avoid ever repeating that mistake. - logic Send stereo output through specific output channels
This probably works for many audio interfaces, though in this case I'm using a Quad Cortex. When I have my interface hooked up to Logic Pro, I want to route stereo output to the specific output channels that are connected to my speakers.
- caddy Serve Markdown files as HTML
Caddy is a simple web server that nonetheless has a bunch of cool features. One example is pre-processing responses using Go's
text/template
package. - redbean Bundle files into a redbean zip archive
redbean is a zip file that contains a webserver that runs on macOS, Windows, Linux and a few other operating systems. You download an executable that's also a zip archive, and it'll serve any files you add to the archive.
- rsbuild Migrate from Create React App
I just tried to get SongRender running again. I started the React codebase in 2018 with Create React App — a choice that, six years later, has aged poorly.
- caddy Run a local static file server over HTTPS
It feels like every server-side runtime has a one-shot command to run a local web server. Node has
npx http-server
, Python haspython -m http.server
, etc. That works fine if you can serve your files over HTTP, but what if you need to use HTTPS?