prune early and often

2026-03-31

uv is amazing but it does come with a sneeky little downside. Every time and you create a cache there's a good chance that it will stick around for-ever. Especially if you create many demo projects with their own environment.

That's why, like flossing, you'll want to frequently do this:

uv cache prune 

Just today this saved 168.2Gb from my drive!

3b1b setup guide

2026-03-25

3Blue1Brown Setup Guide

This is an AI generated guide I wrote for myself that I put up on my blog for safekeeps.

This tutorial covers how to replicate Grant Sanderson's interactive math animation environment (as seen at the start of this video) using the ManimGL engine and the uv package manager.


1. Environment Initialization

Grant uses ManimGL (the OpenGL version), which allows for real-time interaction. Use uv to manage the specific legacy dependencies required.

# Create project and pin stable Python version
mkdir math-animations && cd math-animations
uv init
uv python pin 3.12

# Install ManimGL and legacy compatibility tools
uv add manimgl "setuptools<70.0.0"

2. Fixing LaTeX Dependencies

Manim renders math via LaTeX. If you see .sty file errors, you are likely using a minimal LaTeX install (like BasicTeX) and need to add specific packages via your terminal:

sudo tlmgr install calligra relsize standalone preview doublestroke fundus-calligra

3. The Interactive Script

Create start.py. This script uses self.embed() to open the interactive window and an IPython terminal simultaneously.

from manimlib import *

class InteractiveScene(Scene):
    def construct(self):
        plane = ComplexPlane()
        self.add(plane)

        # Input Dot (Yellow)
        dot = Dot(color=YELLOW).shift(RIGHT)
        self.add(dot)

        # Output Dot (Pink) following w = z^2
        out_dot = Dot(color=PINK)
        out_dot.add_updater(lambda m: m.move_to(
            plane.c2p(plane.p2c(dot.get_center())**2)
        ))
        
        # Visual trail
        trace = TracedPath(out_dot.get_center, stroke_color=PINK)
        self.add(out_dot, trace)

        self.embed() 

4. Running the Setup

Execute the following command:

uv run manimgl start.py InteractiveScene

5. Interaction Controls

Once the window opens:

  • Mouse: Click and drag the yellow dot to see the pink dot react.
  • Terminal: Type dot.set_color(BLUE) in the IPython prompt to see the change live.
  • Camera: Right-click and drag to rotate into 3D; use Z + scroll to zoom.

The Sediment of Software Chart

2026-03-08

I started maintaining a new project that tracks the evolution of a Github repository using "sediment" charts. The final output is a Github Pages site that lets you explore sediment charts for different Python projects. Here's one example for the sentence-transformers library.

Uploaded image
There's not a whole lot of action between 2022-2024. But then huggingface took over maintainership.

These charts track each line of code in the project and how it's changing over time. The resulting chart looks like layers of sediment that changes over time.

For Python projects you can also overlay the version number, to try and get some extra context. Usually, Bitco changes coincide with the new version, like with the Django projects shown below.

Uploaded image
Around version 4 you can see a big shift where a lot of *recent* code is changing. Maybe they updated the docs here? Or possibly switches from flake8 to ruff?

I like to think these charts also say something about the health of a project. A good project shows more code being added over time, but without huge changes to past code. The most healthy image I found so far is for marimo. This is my employer, and it is nice to see how the chart matches my experience with the culture there.

Uploaded image
This project is relatively young, so time is measured in quarters instead of years.

Over time I hope this project might track the effect of coding agents. Are we going to see a big spike up? Is it going to rewrite everything from the past? Time will tell, but these charts will give me a nice summary. If you are curious you can run the notebook yourself if you want to give it a spin for your own projects.

I also recorded a YT video for this work here, if you prefer to see a live demo.