Vol. II · No. 156
Established 2025

smallweb

Friday, June 5, 2026
160 writers in the library
Tech · 2 shelves
TechDesign

Alan W. Smith.

Creative coding, building tools, and digital experiments.

Recent essays

30 of 54

Stress Writing

Normally, I write to think. Today, we're trying something new. Writing not to think. Or, really, writing to not think about things that are stressing me out. I'm one of the least stressed folks I know. I can go with pretty much any flow without much fanfare. T…

The AI Phone Assault Has Begun

I'm visiting a friend of the over 65 variety. His name isn't Ron, but that's what I'm going to call him. His mind used to be very sharp. It's dulled a lot this year. He's a naturally trusting soul and I'm worried sick about him. Incoming Ron told me his bigges…

Sleep for a Time in Rust's tokio

use tokio::time::{sleep, Duration}; sleep(Duration::from_millis(100)).await; println!("100 ms have elapsed");

Open Videos - March 30, 2026

The current set of video tabs I have open right now. Archiving them here and closing them in the browser.

Pulling Magic Commander Rankings from EDHREC

I'm working on a tool to help me build Magic Decksmdb. It'll let me search and assemble cards from data via Scryfallsf. I also want to see other folks are doing. For example, which are the most used commanders. I'm grabbing data from EDHRECedh for that. This i…

Parse a String of Text into JSON in Python

import json input = '{ "alfa": "bravo", "charlie": "delta" }' data = json.loads(input) print(data) print("----") print(json.dumps(data, sort_keys=True, indent=2, default=str)) Output: {'alfa': 'bravo', 'charlie': 'delta'} ---- { "alfa": "bravo", "charlie": "de…

Using IndexedDB to Store Key Value Pairs with Vanilla JavaScript

Dear RSS Reader: The original version of this page includes JavaScript. It probably won't run in here. So, any functionality it might have had probably won't work. Check out the original page to see it in action. I'm working on a Magic Deck Buildermagic. There…

Music for Today (March 15, 2026)

I published a big block of work last night. Stayed up super late to do it. Today, I'm zoned out. In the post-deployment come down. I've mostly been poking around youtube. Lots of music in the mix. A few selections from the day. Down to the River to Pray - The…

You can't update an input text value with keydown

It doesn't look like there's a way to update the value of an field with keydown events. You can, of course, just update the value directly. Simulating keyboard interactions needs to be done with something like puppeteer.

Update CSS Live using contenteditable (No JavaScript Required)

Dear RSS Reader: The original version of this page includes custom CSS to style the page. It probably won't work in here. Check out the original page to see it in action. I was reading the HTML Living Standard for contenteditable to figure some stuff out for b…

Restart fseventsd on a mac

if fseventsd is taking 100% or more of a CPU you can restart it by quitting it in Activity Monitor (after which it restarts automatically). fseventsd will probably be visible if it's having an issue. You can also search for it, if it's not for some reason. Qui…

Guidelines for Building a Static Site Generator (2026 Edition)

The Next Generation I've built several static site generators for personal use. Early ones were to support neopolitan. Later ones were to make it easier to build sites in general. Now, I'm looking to move my site from alanwsmith.com to al9000.com. Part of the…

Get a Random Number with crypto.getRandomValues() in JavaScript

Dear RSS Reader: The original version of this page includes JavaScript. It probably won't run in here. So, any functionality it might have had probably won't work. Check out the original page to see it in action. The Road to Random I'm adding some randomizing…

Prevent a Checkbox from Staying Checked when a Page Refreshes in Firefox

This one bit me. In some browsers, a checkbox that's been checked will revert to unchecked by default if the pages refreshes. That's not true in the current version of Firefox. You have to add autocomplete="off" to make it consistent with the other browsers. F…

Filter the First N Number of Items from a JSON Array with jq

Use jq's [start:finish] to filter JSON to remove all but the first N number of items from a JSON array. For example: For example: echo '{ "items": ["a", "b", "c", "d"] }' \ | jq '.items = .items[0:2]' Output: { "items": [ "a", "b" ] } More Range The start and…

A `jq` Filter for Card Types from Archidekt JSON Feeds

I'm making my own Magic: The Gathering deck maker. It's based on feeds from Archidekt. The process I'm doing is to make big collections of cards for each color/color-combination to start with. I filter those down to make actual decks. My first step was to spli…

Default Pages for a Static Site Generator

More work on bitty's1 documentation is under way. I'm using files and directories for all the data instead of putting it into a database. Pages are assembled by including files inside each other. I use a directory structure like this: data-receive index.html t…

Walking a Directory with Directory Parts in Python

Working on bitty. Setting up a copy system for making tests. This is the way I'm pulling direcotires to build out a little easier. The idea being that I need to keep the positions of the input directories relative to a template structure. I've done this like a…

Fall Back to a Default Include File in MiniJinja

I'm working on upgrading the documentation for bitty. Everything is built with MiniJinja (rust's version of the Jinja template engine). Very section has live test code with it. Most of the tests trigger the same way. A few don't. I wanted a way that I could us…

Empty a Folder in Python

This is how I clear out everything inside a directory while leaving the directory itself intact using Python: import shutil from pathlib import Path def empty_folder(path): for item in Path(path).iterdir(): shutil.rmtree(item) if item.is_dir() else item.unlink…

Formatting Dates in JavaScript with Intl.DateTimeFormat

Dear RSS Reader: The original version of this page includes JavaScript. It probably won't run in here. So, any functionality it might have had probably won't work. Check out the original page to see it in action. Logging When I'm working on logging for the nex…

Dates and Times with ISO 8601, RFC 3339, and RFC 9557

What Time Looks Like Things to know about formatting dates and times in the world of computers: ISO 8601 is the longstanding champ1. RFC 3339 is the new ISO 8601. RFC 9557 is the new RFC 3339. ISO 8601 lets you format date/times in a few way. For example: 2026…

Get a Substring Slice in Python

You can get part of string in python using the same approach you would use for lists: input = "alfa bravo charlie" output = input[:4] print(output) Output: alfa input = "alfa bravo charlie" output = input[5:] print(output) Output: bravo charlie input = "alfa b…

Weeknotes (Ending Feb. 20, 2026)

Monday, Feb. 16, 2026 It's still weird to type 2026. bitty. I'm just gonna push everything into the imported classes themselves instead of having to go through this.api.whatever(), you'll be able to just do this.whatever(). Spent some time digging into rust an…

Weeknotes (Ending Feb. 13, 2026)

Tuesday, Feb. 10 Been working on bitty and my Magic: The Gathering Deck Refiner a lot. The deck refiner is informing the work I'm doing on bitty. While taking a nap, I realize I could use another approach with bitty where I don't wrap other elements inside it.…

The Terser JavaScript Minification Tool

https://try.terser.org/ This is the REPL minification tool I'm using for bitty. I haven't automated the process yet. That's on the way. -a

Moved from Spotify to Apple Music Again

I've jump back from Spotify to Apple Music. I'm probably imagining things, but songs sound better. Like, the first song I played after I switched blew me away. I had Spotify quality set to as high as it would go. Maybe they were doing something else? Of course…

Generate a Repeatable UUID in Python with UUID v5

The UUID spec provides a way to generate UUIDs that will always be the same for a given input. Useful for things like making RSS feeds where you'll create a file multiple times but what the UUIDs to stay the same without having to store them. Creating on in Py…

Pretty Print MiniJinja Data as JSON

Use the built-in tojson filter and pass it a true argument to pretty print MiniJinja data as JSON. {{ some_data|tojson(true) }} or, with alternate tokens: [@ some_data|tojson(true) @] The indent size sets to two spaces. You can also pass an index=# argument to…

Weeknotes (through Feb. 6, 2026)

Saturday - Jan. 31, 2026 Working on my Magic Deck Builder. It's giving me a chance to exercise bitty. I'm also learning how to use the BroadcastChannel API to have multiple browser windows update each other. The idea is to have two screens for the deck builder…