Chinese Zodiac Time for Emacs

In the spirit of Chinese New Year, I hacked up a small extension for Emacs to render the current time of day using emoji and Chinese characters:

Various screenshots of Emacs showing the time displayed with Chinese characters and emoji.

Various configurations for your mode line.

Fix clj-refactor Libspec Stealing

(This post is regarding a very particular issue at the intersection of Emacs, Clojure, and CIDER, so most readers can probably skip it, but I figured the solution deserved to be somewhere on the internet.)

CIDER has this awesome feature via clj-refactor where it can automatically add missing libspecs to your ns form as soon as you type an aliased var name using an :as alias you have previously used for that namespace:

Screen recording showing how CIDER and clj-refactor can add missing libspecs.

Screen recording showing how CIDER and clj-refactor can add missing libspecs.

You can define a preferred set of (:as) aliases via cljr-magic-require-namespaces in your Emacs config, and, whether you’ve done that or not, CIDER tries hard to be smart, offering you choices if you’ve previously used the same alias for different namespaces in different places in your project (e.g. s/ for clojure.spec some places and the same for clojure.string in other places).

Moreover, CIDER evaluates the namespace form, bringing in the new requires, allowing you to just keep typing and coding, without breaking your flow.

This is all fantastic, but I ran across one particular scenario where this kept biting me: my user namespace.

Clojure Thread Dump

From the department of How Did I Never Learn This in 12+ Years of Clojure? comes today’s tip:

Did you know you can generate a thread dump (+ memory usage information) from a Clojure REPL with a single keystroke? I sure didn’t.

Notes on Upgrading Datomic On-Prem to v1.0.6726

After the news from the Clojure/conj that Datomic is now free, I was excited to get home and upgrade and access newer features and high-availability. Herein are notes from how that upgrade process went that I hope will be helpful to anyone else upgrading, including difficulties I had running the official Datomic AMIs.

How to Create a Customized Clojure Docker Image

Creating a Docker image isn’t particularly difficult, but I never do it often enough to remember the incantations required. Yesterday I needed a Docker image for running CI jobs on Circle CI. There are some great pre-built images out there, but I couldn’t find the combination of Java 17, Leiningen, and Node that I was looking for. This is a quick guide to how to build your own image with the tools you need.

Regex Optimization in Clojure

Earlier this week, after responding to a post on ClojureVerse, I got curious about re-implementing the basics of Emacs’s regexp-opt function in Clojure. I thought it would be a fun little coding exercise so I decided to take a stab at it during a few spare minutes in my day and was very pleased with the concision and clarity of the result.