lsv: a Rust powered terminal file browser

I finally snapped after one too many trips through modern file browsers on macOS and Windows. Click. Wait. Tiny target. Modal dialog. Repeat. I spend most of my day in a terminal anyway, so I built something that fits how I actually work.

lsv

Say hello to lsv.

  • Fly through directories with the keyboard
  • See a preview of the thing I have selected
  • Hit a key to run a command I chose
  • Keep the config in plain text so I can version it and move it across machines
  • A small terminal file browser written in Rust, scripted with Lua
  • Think of it like a fast directory lister that speaks key bindings and previews
  • Inspired by the excellent lf, but with a setup that matches how I like to glue tools together
  • I have been learning Rust for a few years and have built some small apps and tools with it, I like the language and it promises increased memory safety which is nice but the real reason is i like the tooling the language comes with, how it manages dependencies, and the cargo system along with crates.io for distribution.
  • Lua keeps the configuration simple and flexible without writing a plugin system

You can bind keys to run shell command. e for example might launch the selected file in your $EDITOR or i use t to launch a new tmux pane for the current directory, or gs which is bound to lsv.os_run("git status -C {current_dir}") to see the results in a results window.

Porting Asteroids to an ECS with Codex

Quick version: I rewired my Asteroids clone from a pile of classes to an Entity‑Component‑System (ECS). Codex (the CLI agent) did the heavy lifting while I poked, prodded, and occasionally muttered at my screen. The end result is cleaner, easier to extend, and less brittle when I add toys like missiles and sparkly shields.

Why bother with ECS?

  • I was done fighting class hierarchies. I just want to slap “has a shield,” “spins,” or “is a missile” onto things without negotiating with a base class.
  • Data is data, behavior is behavior. Components hold state; systems do the work over sets of components.
  • (maybe) Performance as a side effect: tight loops over similar data are fast, but honestly the clarity is what sold me.
  • New features become “add a component, tweak a system,” not surgery across five files.

Where I started (a.k.a. the creaky bits)

Using gpt-oss-20b to Build Asteroids and Breakout

In this post I explore how to use gpt-oss-20b, an open source 20-billion parameter language model, to prototype two classic browser games: Asteroids and Breakout. By iterating on prompts and refining the output, I generated working HTML5 Canvas implementations in around an hour or so.

gpt-oss-20b is an open-source 20-billion parameter transformer-based language model released by OpenAI under the Apache 2.0 license. It is based on the GPT-4 architecture scaled to 20B parameters, trained on a diverse mix of web text, code, and documents.

Memento Mori

“Let us prepare our minds as if we’d come to the very end of life. Let us postpone nothing. Let us balance life’s books each day. … The one who puts the finishing touches on their life each day is never short of time.”


Seneca

I have read some stoic philosophy recently and one of the ideas it presents is the awareness of death, not in a morbid sense, but as something we should remain aware of. Time passes, often without notice when we are busy in the day to day living, but stoics such as Marcus Aurelius believed it was important to acknowledge that your life span is finite and to act accordingly; use it as a call to action.

Software Architecture

What is software architecture?

It depends. Everyone in IT asks this question at some point and the answer they get is a mixed bag depending on who tries to answer it. So to deepen the general state of confusion I thought I would add yet another definition.

It depends. I think of Software architects as “Master builders”. They may not have the title “Architect” but they are doing most of the following:

On the Design of Small Things

Those who do not understand UNIX are condemned to reinvent it, poorly.
Henry Spencer

The following is from the wikipedia article on Unix Philosophy. It is interesting to apply these rules when designing Microservices, there is significant overlap. Unix did it first.

In his book, The Art of Unix Programming that was first published in 2003, Eric S. Raymond, an American programmer and open source advocate, summarizes the Unix philosophy as KISS Principle of “Keep it Simple, Stupid.” He provides a series of design rules:

2016 Round-Up

So another year draws to a close and I thought I would review the last 12 months in my favourite data struture; lists. Think of this as a far less interesting homage to Fogus yearly reviews.

Over the last few years I consume less technical books purely because the content to be found online can be of great quality and books can rarely keep track with the rate of change in tech. Usually if I am reading a tech book its of a more abstract or fundamental topic rather than specific to a language and is therefore a longer living.

Software, Estimation and the Planning Fallacy

My flight is delayed for 3 hours so I’m taking the rare opportunity to put together some thoughts on how software project estimation can trip companies, teams and individuals up.

Remember way back when everyone thought the Waterfall model was great? Well actually no, for the most part they didnt. The Waterfall model was put forward by Winston Royce back in the early 70’s as an example of a broken SDLC model. Unfortunately this little note was lost in the scramble to adopt it as the de-facto model to use. Now what is interesting to me is its original creator could see that the waterall model contained flaws, but thousands of people could either not see those same flaws, or were unable to cease its adoption even if they tried; I’m not sure which of those is worse. 30 years later you would be hard pressed to find any organizations still working under a Waterfall model, which is good. The real problem however is not that a mistake was made, its that it took a generation before we acknowledged there was a problem.

Directed Graph of hubski users created with D3

Using some c# code to scrape hubski.com I was able to produce a pretty basic directed graph showing users follower connections.

Source code on github

Demo version

Advanced Demo version

Hubski Social Graph

I started off by scanning a users profile and recording various pieces of information such as:

  • Age in days
  • Number of followers
  • Number of people followed
  • Number of badges received.

I then looped over each of that users followers and recorded the same information, and then their followers, and then their followers… you get the idea.