Evan Hahn (dot com)

https://evanhahn.com/blog/

My blog, mostly about programming.

フィード

記事のアイキャッチ画像
"Sixteenth of a year", a 1.8 KiB art piece
Evan Hahn (dot com)
As I write this, we’re about 7 sixteenths through 2026, and it’s about 14 sixteenths through the day.For the sixteenth issue of the Taper online magazine, I split time into sixteenths to think about its passage in a different way.The code, which had to be under 2048 bytes, isn’t terribly complex. It does some date math and uses a Go server for minification. If you want, here’s the unminified source code.Go check out all the other entries from this issue! My favorites include "[SIC]", “Desperate Measures from a Dying Regime”, and "(un)done".See also: my previous Taper entry.
25日前
記事のアイキャッチ画像
Notes from May 2026
Evan Hahn (dot com)
My blog turned 16 this month! I did nothing to celebrate, but made some little tools and clicked some links about tech ethics.Things from me this monthI published four little tools this month:ZIP Shrinker, a web app that shrinks ZIP files with higher compression ratiosA command line tool to do (completely offline) translationOpen Link in Unloaded Tab, a Firefox extension to open links without loading thempng-cmp, a command line tool to compare PNG pixel dataI also did some work on Helmet, my open source project:After over a year of quiet maintenance, I released version 8.2.0 with some small new features and documentation updates.In a step toward dropping GitHub, I moved the docs from a GitHub URL to helmet.js.org.And like every month, I wrote a few articles at Zelda Dungeon. I don’t feel I wrote anything special this month, but my colleagues put together a feature about Zelda and mental health which was very affecting!Links to click on“The vast majority of tech workers, at least those
1ヶ月前
記事のアイキャッチ画像
Make ZIP files smaller with ZIP Shrinker
Evan Hahn (dot com)
I built ZIP Shrinker, a little browser tool to shrink ZIP files. It also works with formats that are secretly ZIPs underneath, like EPUB, JAR, and many more.Try it out!How does it work?At a high level, this tool (1) re-compresses every file in the ZIP archive with higher compression (2) removes all metadata (3) removes entries for directories.Re-compressingZIP files are typically compressed with an algorithm called Deflate.There are a few tools that can re-compress Deflate data and make it smaller, usually by spending more time on the computation. I took one of these tools, libdeflate, and applied it to each compressed entry in the ZIP. I chose libdeflate because of its performance; alternatives like Zopfli can achieve marginally smaller results but take much longer.I created libdeflate.js, a WebAssembly wrapper for libdeflate, as part of this work. (I always relish my time working with WASM!)Removing metadata and directoriesEach entry in a ZIP file can contain additional metadata like
1ヶ月前
記事のアイキャッチ画像
Open Link in Unloaded Tab, a little Firefox extension
Evan Hahn (dot com)
In short: I just published Open Link in Unloaded Tab, a little Firefox extension that adds “Open Link in Unloaded Tab” to the right-click context menu.In Firefox, you can unload tabs to save system resources. But there’s no way to open a new tab in the unloaded state…until now! I built a very simple extension that adds a new option to do this. (It even has a cute icon which I paid ~$15 for.)I’ve built one-off extensions before, but this is the first one I’ve submitted to the Firefox Add-ons directory.Download the extension here or check out the source code.
1ヶ月前
記事のアイキャッチ画像
png-cmp: like cmp for PNGs
Evan Hahn (dot com)
png-cmp is a program I built that checks if two PNGs are visually equivalent. It’s inspired by the cmp command. Here’s how you use it:png-cmp a.png b.pngLike cmp, it silently exits if the images are identical, and gives an error if they’re different.Unlike cmp, it checks pixel data, not binary data. PNGs can look the same but be stored differently. For example, png-cmp ignores text metadata.I was recently doing an experiment where I wanted to check if two PNGs were visually identical, so I built a tool for it!Grab the source code here.
2ヶ月前
記事のアイキャッチ画像
Offline command line translation with TranslateGemma + Ollama
Evan Hahn (dot com)
I wrote a simple script that translates text at the command line, completely offline. Here’s an example of how it works on my computer:echo '¿Cómo estás?' | translate# => How are you?It combines a few tools:TranslateGemma, a special-purpose language model for translationOllama, a tool for running language models locallyEfficient Language Detector, a library that detects the language for a piece of textHere’s the pseudocode of how it works:source = read_stdin()# Uses Efficient Language Detectorsource_language = detect_language(source)# Uses JavaScript's `navigator.language`target_language = get_system_language()# Uses Ollama + TranslateGemmareturn translate(source, source_language, target_language)I built this because I couldn’t find anyone else who had done it. It’s written in Deno for my specific needs—for example, it only translates text into your system’s language—but could easily be adapted if you need something else.I like that I can do offline, private, automatic translation. It’
2ヶ月前
記事のアイキャッチ画像
Notes from April 2026
Evan Hahn (dot com)
After a busy March, April was a little quieter. But don’t worry, I still have a bunch of little links for you to click on.Things I publishedGitHub’s uptime hasn’t been great recently. Even though I dislike the Microsoft subsidiary, I wrote “In defense of GitHub’s poor uptime”, which argues that it’s not as bad as folks seems to be saying. See this Lobsters thread for some discussion.Published version 0.2.0 of setbigtimeout, my JavaScript library for waiting a very long time.Like every month, I published a few articles over at Zelda Dungeon. We had a slew of shitposts for April Fool’s this year. I think my favorite (not written by me) was “Daily Debate: Do You Think Old Man Was Once Young Man?”.Links I clickedGhost, my employer, was recognized as a digital public good.“You can’t advertise people out of reacting to their own experiences. This is a fundamental disconnect between how tech people with software brains see the world and how regular people are living their lives.” From “The pe
2ヶ月前
記事のアイキャッチ画像
In defense of GitHub's poor uptime
Evan Hahn (dot com)
In short: GitHub’s downtime is bad, but uptime numbers can be misleading. It’s not as bad as it looks; more like a D than an F.“Zero nines uptime”?99.99% uptime, or “four nines”, is a common industry standard. Four nines of uptime is equivalent to 1.008 minutes of downtime per week.GitHub is not meeting that, and it’s frustrating. Even though they’re owned by Microsoft’s, one of the richest companies on earth, they aren’t clearing this bar.Here are some things people are saying:“GitHub appears to be struggling with measly three nines availability”“World’s First Enterprise Solution With Zero Nines Uptime”“Sure, they may have made the uptime worse, but remember what we got in exchange – when it’s up, the UI is slower and buggier.”According to “The Missing GitHub Status Page”, which reports historical uptime better than GitHub’s official source, they’ve had 89.43% uptime over the last 90 days. That’s zero nines of uptime. That implies more than 2.5 hours of downtime every day!I dislike Gi
3ヶ月前
記事のアイキャッチ画像
Notes from March 2026
Evan Hahn (dot com)
March always seems to be my life’s busiest month.Things I wrote and made“The two kinds of error”: in my mind, software errors are divided into two categories: expected and unexpected errors. I finally wrote up this idea I’ve had for a long time.“All tests pass” is a short story about a strange, and sorta sad, experience I had with a coding agent.Inspired by others, I published a disclaimer about how I use generative AI to write this blog. My main rule of thumb: the final product must be word-for-word what I would’ve written without AI, given enough time. And I have discomfort about its use.Built llm-eliza, a plugin for LLM that lets you use the ELIZA chatbot at the command line. I think this is my first satirical software project. (Also the first thing I’ve published to the Python package registry, PyPI.)Found the human.json standard, which is “a protocol for humans to assert authorship of their site content and vouch for the humanity of others.” I added it to my site this month.Scrape
3ヶ月前
記事のアイキャッチ画像
All tests pass: a short story
Evan Hahn (dot com)
One night, I wrote a simple tool to pick a random programming language. After shuffling a few times, I landed on Arturo. I decided to try it for fun.What’s Arturo?Best I understand, Arturo is a stack-based programming language. It’s primarily maintained by Yanis Zafirópulos. They published a vision of the language in 2020. Here’s the stated goal from that post:to make something that I myself will use as an easier do-it-all scripting language, you know… automation scripts, templating, latex generation and perhaps help me a bit in the packaging of webview-based applications (think of Electron, but something far more manageable and without having to deal with Node.js and the likes).As a stickler for syntax, I bristle at this writing. That first word, “to”, should be capitalized. In fact, the whole sentence is too long and structured strangely. “latex” should be “LaTeX”.This post, while readable, could be edited for clarity and correctness.Arturo’s website, on the other hand? Flawless! Not
3ヶ月前