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.
I’ve long thought it was a little funny that Emacs doesn’t provide an
easy way to run a shell command on the current file. It turns out it
does, but it’s not as obvious as you might expect.
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.
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.
Lately I’ve been dabbling in using commas to control indentation in
Clojure. I’m sure this will be a contentious one, but I wanted to put
it out there to spur converation.
There’s a loose convention in Clojure of leaving top-level (comment ...)-style comments in source files to give examples of how a
particular piece of code works or to provide a convenient means of
invoking functionality contained in the file. You can even see this
in the source files to Clojure proper.
Even though leaving commented out code can seem a bit messy, it has
also saved me a ton of time relearning how to invoke something, so I
have somewhat mixed feelings about the practice. But, regardless of
the merits of using this in production code, it’s unarguably useful in
development, and I use it extensively as I work to test out function
invocations with different arguments, and to store little bits of test
data.
Frustratingly, this form does not play nicely with CIDER’s C-M-x
(cider-eval-defun-at-point) and C-c M-;
(cider-eval-defun-to-comment) commands, which expect the target form
to be at the top-level of the file. The containing (comment ...)
form means that technically isn’t so, leading me to perpetually
evaluate the wrong form…
When working on CollBox, we have a handful of external services
the app depends on which we need to have running at development time.
I used to run these via Foreman, but somewhere along the way my
Ruby installation seems to have gotten borked (thanks, Catalina?)
and since then I’ve been running the services by hand. I always work
in a tmux session anyway, so I decided it was time to see
what it would look like to launch my window full of dependencies in
tmux from a script.
Last year I tried out making a reading list in
January, to keep myself reading at an acceptable pace, and to put a
bit more foresight into what I would be reading. This worked out
pretty well. Despite finishing a couple of my 2016 books in the first
days of 2017, I largely stuck to my schedule, and I finished
everything on my list, including a few rather lengthy items. I
actually didn’t read a whole lot more than I had listed (to my
surprise), which makes me even more confident that this is a good
idea, since it sets a minimum reading curriculum.
Again this year, I’ve tried to establish some common themes to allow
for comparative reading and amass some knowledge of a field. The
stronger themes are decision-making (four books) and creativity (four
books), and the remaining four books are loosely centered on
self-improvement, though that’s more of a coincidence than a plan.