Things I'm Likely to Forget

Closing Branches in Mercurial

As a lone developer, I have a workflow that I believe is pretty typical. Most of my development work happens on the “tip” of the “default” branch. It’s just easier to do work on fixing small bugs or adding minor features there. For more significant, more difficult pieces of work, I usually create a “feature branch.” I do this with the expectation that if things get messed up too badly, I can delete the branch and start over without affecting the readiness of the default branch.


For the past few months, I’ve been beating my head against a brick wall. The problem was that I was trying to get an all-server-side wiki built using Clojure. It actually works pretty well. I’ve been using it for personal information for months now. It works well except for one aspect, arguably the most important – editing new or existing content is not that pleasant. It’s all a variation of Markdown, which is nice.

Notes on ClojureScript Regular Expressions

There’s an old saying about regular expressions – paraphrasing: “If you try to solve a problem with regular expressions, you then have two problems.” Even though regular expressions are present in most programming languages, I have never become particularly proficient with them. Those that I am most familiar with are the Java version. Since ClojureScript compiles to JavaScript and runs without the Java underpinnings, it’s version of regular expressions are different.

Using Anonymous Functions in the Clojure/Script Thrush Macro

The other day, I was putting together a sequence of operations to transform one piece of text into another form of that same text. The functions took a text argument, and the result was a slightly tweaked version. Put all those functions together to get the fully transformed result. What could be more natural than to string those pieces of code together with one of Clojure’s threading macros: ‘->’ or ‘->>.

Restart River5 after Reboot with PM2

I run a River5 “River of News” on a Raspberry Pi wirelessly connected to my internal home network. Sometimes, the power fluctuates, and the Pi reboots. I want to have River5 restart when the system comes back up. There are lots of ways to restart stuff on Linux. (I am running Raspian GNU/Linux 8.0.) The process manager I use is PM2 – mostly because it knows Nodejs. River5 is written for Node.

New Blogging Setup

It’s been a bit of a slog, but things should be up and running again. The transition was a bit harder than expected. Here are some things you should know: The site is generated by the Hugo static site generator. The site uses a trivial modification of the very pleasant Blackburn theme. There are still some kinks I want to work out, but it is very useful overall. The repository for the site is on GitHub here and is generated from the information in the repository here.

So Many Broken Links

As noted in yesterday’s blog, I’m making a sweep through my previous posts trying to fix links that have broken over the years. This is in preparation for switching to another blogging platform. I find that the rot even creeps into the README.md files in my own code repositories. Many of them refer back to descriptions of the repositories posted to no longer existing versions of the blog. I’ll fix those as soon as I can.

Bit Rot

Every once in awhile, I change blogging platforms. Recently I have been working on a switch to Hugo. Whenever I go through this exercise, I religiously check for broken links. There are always plenty. Most of the time, when broken links are found, I can find a replacement. Sometimes not though. Sometimes something is just gone. No new address. No record in the Internet Archive Wayback Machine. Just gone. I know I’m contributing to this myself by changing hosts and blogging platforms.

A Timestamp Plugin for Sublime Text 3

Since switching from Windows to a Mac in the middle of developing a new wiki, I lost access to the MarkdownPad Markdown editor – it’s Windows only. One of the nice features of MarkdownPad was the ability to insert a timestamp easily. It’s what I used to insert the creation date and the time of the last modification. Since the switch, I’ve been using Sublime Text 3 as my editor for Markdown files.

Another Useful Function -- convert-seq-to-comma-separated-string

This is a little note about a function I find myself using frequently in Clojure. User interface code often needs to display a list of things as a comma-separated list, e.g. “a, b, c, d”. If all of the things are strings, you can use the built-in string/join function to build such a string. When you have a sequence of things that are not strings, I suppose you could convert each element to a string and then use string/join.