Notes on enginering leadership and software development.
#coding
2025
Had to spin up a new work laptop, so I figured — I'll tweak my Zed setup, do some dogfooding, and show you how to make Zed AI assist awesome!
Embedding Excalidraw drawings from Obsidian in Contentlayer / MDX.
With dark mode support and a custom Vercel build script.
2024
Or how Claude sent me on a side quest for the perfect language code API.
Turns out, rendering MDX in an RSS feed in Next.js is a PITA
You can make iOS and Mac app icons directly with SwiftUI, without any design tools like Figma!
2023
Contentlayer is the easiest way to setup markdown with mdx source to static website pipeline. Here's how it's implemented in respawn.io.
Shipping your library's DocC documentation to GitHub Pages, and keeping it up to date with a GitHub action.
Using swift-docc-plugin for SwiftPM to export your docs, and swift-docc-render to get a static website with your documentation.
2022
When you can't quite use the Migration Assistant, but not ready to geek out all the way with Ansible.
I had a couple hours on a Thursday night, and wanted to clean up my website. The result is this: a blog built with Obsidian, Markdown, Next.js, Contentlayer, and a few hacks to glue things together.
Daily Notes
January 29th:
Back to Swift on Server thingsGot a few new PRs merged into Swift-NIO! It feels so great when folks say thank you 🖤
January 10th:
Counterscale supports `pushState` now@benvinegar
's Counterscale supports SPA push state apps now! I've set it up for respawn.io, and unless I messed it up, I'll public analytics dashboard in a couple of weeks.December 31st:
TIL `npx concurrently`Was writing a few posts this week, and finally got tired of running
contentlayer2 dev
andnext dev
in two split panes.So, I added a new script to
package.json
:{ "scripts": { "dev": "pnpm run contentlayer dev --parallel 'next dev'" } }
Was really tempting to bring Overmind from my Rails days, but this works.
December 2nd:
Advent of Code 2023, in Swift!There's a reason you stick with Python for Leetcode-style problems. And yet, I was itching to learn more Swift, so I'll do Advent of Code this year. In Swift!
November 19th:
Contentlayer supports markdown and even MDX formatting in the frontmatter fields of your documents, as long as you specify the field type as
mdx
ormarkdown
.The tricky part is that:
markdown
fields give you raw HTML code. You'd have to wrap it in__dangerouslySetHTML
or something.mdx
gives you the code that you have to pass intouseMDXComponent
to render.- Either way, you have to decide where to allow markdown formatting and where to strip it.
I've just implemented it for the blog here:
- Posts lists gets new
PostDescription
component that renders MDX-processed post description. - Post metadata and RSS gets raw description, implemented in a little custom field on Contentlayer that strips formatting.
July 18th:
TIL there are
beforeprint
andafterprint
events onwindow
in Javascript, so you can manipulate the DOM to make the print version look nicer beyond what you can do with print styles in CSS.Especially helpful to hide a 3rd-party iframe (in our case, Intercom widget) that otherwise caused the printed page to overflow horizontally.