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.

70 TILs so far!

Recent TILs

  • windows

    Create a file without an extension

    I was trying to save a file without an extension from Notepad. For some reason, even if I removed the extension from the filename and selected "All files", it still saved as a .txt.

  • git

    Add a global .gitignore

    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.

  • valibot

    Parse a Date or string into a Date

    One common pattern with TypeScript projects is using a validation library like Valibot to validate incoming data at points of ingress to your application. (Intentionally or unintentionally, this is the "parse, don't validate" pattern, coined by Alexis King in her excellent blog post of the same name.)

  • fzf

    Make a TUI for switching and deleting git branches

    Is dealing with git branches annoying to anyone else? There's a lot of typing long branch names, especially if you're cleaning up a bunch of old branches at oncex.

  • typescript

    Add custom element to JSX.IntrinsicElements

    As of version 19, React supports custom elements!

  • html

    Define a custom element

    I've been using web components for a bit, and I've accrued a bit of code I generally use as a base for my custom elements. "Boilerplate" has a negative connotation, so let's just call it a "web component starter kit".

  • javascript

    Programmatically create SVG elements

    This is simple, but it tripped me up for a bit. TL;DR you can't do this:

  • css

    Anchor scroll position to the bottom

    Recently, I was building a vertical "timeline" for an explorable explanation, in which new elements would be added below any existing ones. As elements were added, I wanted the scroll position anchored to the bottom of the timeline, as it would be in a chat app.

  • nextjs

    Don't server-side render a client component

    React Server Components splits React components into two kinds: server components and client components.

  • volta

    Install Volta with Homebrew

    It seems so easy: just brew install volta and you have a modern Node version manager ready to go!