Clojure Projects

24 March 2025

I have a long list of Clojure projects I’ve created over the years to learn Clojure and accomplish various personal tasks.

Advent of Code

As of the end of 2024, I’ve done at least some of Advent of Code for 7 years in a row. I’ve had the most fun and practice parsing and transforming the input data for each puzzle.

I learned pretty quickly from the puzzles to store the common grids as sparse maps to save lots of memory and keep the problem in memory. I sometimes got stuck on the puzzle and the algorithm, but I still got lots of practice in general Clojure. I definitely see that the Clojure data structures lend themselves well to the puzzles. I’ve gotten to effectively apply lots of common Clojure libraries like core.async and core.logic.

Incidents

My incidents project scrapes an RSS feed of emergency response incidents in Lancaster County and stores them into an XTDB database for history. It generates static site of current events with hiccup and historical charts with Clerk.

Running this project day-to-day, I learned that the Clojure/JVM start up is a bit too heavy to start frequently from cron, so I run it as a service in systemd with its own scheduling. Clerk and the amount of data I’m processing is also a bit heavy, so I have that scheduled to rebuild less frequently than the scraper. The site is still all static.

Event Logger

With this CLJS project, I was trying to derive a standard shadow-cljs workflow to make sure I could start any new CLJS web project quickly. It started using Reagent, and I migrated to Helix to be less-insulated from newer React features. I also wrote code to migrate data in local browser storage from an old Transit format to EDN. I’m constantly learning the better flows for data in React and local storage.

COVID Warehouse and COVID Web

The beginning of 2020 provided some of us with lots of downtime, so I started loading and analyzing Johns Hopkins University’s data on COVID with my own data warehouse and web app to display my data.

The data was pretty messy early on, and it changed over time, so I needed to parse lots of different formats. I generated a static site with my historic graphs and focused on World, US, and counties in Pennsylvania. It was a classic ETL for a star schema data warehouse, since I wanted to refresh my experience on that. I initially stored in in a SQL database using hugsql and next.jdbc.

After a bit of time, this became my first project to explore CRUX/XTDB and NoSQL data structures. I learned a bit about how changes applied in XTDB and how to limit history and otherwise save space on my small server environment. I could easily apply core.async when it was time to get things done faster.

The web app project that I added later provided a more dynamic Reagent app in CLJS that used the static data produced by warehouse project.

Planning Poker

I wanted a simple tool for conducting planning poker in sprint planning, so I built one in JS to run on mobile phones. When I started learning CLJS, I converted it to Reagent and used Leiningen to build it.

Clojure All the Other Things!

I’ve enjoyed finding there are ways to apply Clojure to everything!

Structured Intepretation of Computer Programs

Music in Overtone

I have a project where I play with data structures for music and explore lots of examples in Overtone, including Rich Hickey’s experiments in additive synthesis and sequencing some simple beats from drum-n-bass tutorials for other DAWs.

It required lots of yak-shaving work over the years to keep the native wiring to Supercollider and Linux sound working.

3D Objects

I’ve found a library to interface Clojure to OpenSCAD, so I have some 3D models defined in Clojure code for printing.


Design First, Measure Second

11 March 2022

My objects repository is full of OpenSCAD code. At the top of each file you’ll find a collection of variables in the code: the measurements of the model.

We don’t need to get bogged down with those exact values to start modeling, but we know that we’ll want to identify certain parameters to size our models. We can start banging together some shapes (with union and difference), and any time we’re tempted to guess at a measurement and plug it into the code, we want to first see if we can give it a name (a variable name, that is) and use that instead and define a rough value for that variable at the top of the file. Next we can think about that value and decide if it’s related to any other values we already have. Often, one value should be calculated relative to other values: overall_width = inside_width + 2 * side_thickness. Once a measurement is defined in terms of other values it’ll automatically update as we start providing more precise measurements.

By starting with some guessed values and later plugging in real measurements, we prove that our parametric model is being correctly calculated from the measurements. We should be able to use this code time and time again to generate variations on the model based on new measurements. Our SCAD model with all the parameters at the top is ready to upload to Thingiverse and the Customizer can let users easily provide their own measurements to generate new models from our code.


ADVi3++ 4

26 August 2020

I had a bit of downtime with my Monoprice Maker Select Plus 3D printer, so I decided it was time to upgrade the custom firmware, ADVi3++ 3.0.x, to the newer 4.0.6.

I’ve done the upgrade previously to get the 3.x firmware in the first place, so I knew I needed to upgrade in 2 steps: the LCD via a microSD card and the main board via Cura over USB.

I dug through the manuals and directions a bit, and decided I could copy the contents of the raw zip onto a formatted SD card instead of writing the img file to the raw SD device with dd. That fit on a handy 2GiB card. I took the couple screws out of the front panel, inserted the micro SD card, powered it up, and watched the LCD display all the new images it was loading. When it’s done, I turned it off, and replaced the screws.

Then I could easily connect the printer to the Linux laptop via USB, and upload the custom firmware hex file from Cura’s Manage Printers screen. I did need to take a moment to add my user to the dialout group to get access to the USB ports for serial communication to the printer.

Upon reboot, the printer wiped out the old incompatible settings, and I rebooted it again to see the new startup screen and version numbers. I ran through some tunings: PID and extruder, and kicked off a test print that went fine.

I currently have the thermal protection enabled, and I’m hoping it’s not too sensitive, and I can keep it turned on. I expect this upgrade will hold for a long time until I see 5.0 available, and it’s had some time to settle.


2018-03-12 Sanding Stick Fix

12 March 2018

The sanding stick needed a little adjustment to be assembled successfully.


All the Posts

March 2025

March 2022

August 2020

March 2018

February 2018

January 2018

February 2016