A few words from Agical

There can be only one!

Here is a stupid simple way to easily manage those UI elements of which there can be only one opened at a time, such as application menus. I call them Highlanders. My requirements are that I want no extra DOM elements, nor any extra CSS, plus that the user’s intent should be honored, either if it is intentionally closing the element or starting to interact with some other element. (Say the menu is open and the user starts to drag something somewhere else.

Läs mer »

Keeping the :arglists of Clojure functions DRY

The problem: function-a takes the same arguments as function-b. In fact, function-a calls function-b. Without too much synchronized updating of the function signatures, I want (doc function-a) to show me the same argument lists as (doc function-b). The solution: Use :arglists in the metadata of the function. (defn function-b [{:keys [a b c]}] (println a b c)) (defn function-a {:arglists '([{:keys [a b c]}])} [args] (function-b args)) That’s the TL;DR. Read on for some rationale, and for some nerdy diving into the worlds of static and dynamic analysis.

Läs mer »

15 second Netlify deploy of a Rust mdBook

I have been enjoying learning some Rust and some Macroquad game development via Olle Wreede’s tutorial (Swedish only so far, sorry!). When I sent some pull requests towards the tutorial I lacked a deployed version attached to the PR. I decided to add that, and my goto for such things is Netlify. However, the tutorial is authored with mdBook, and there doesn’t seem to be a straightforward way to get Netlify to build this.

Läs mer »

Why you should try Clojure Interactive Programming

Clojure has a lot of things going for it. To name just a few: Functional programming is the default. Clojure makes it easy to keep data immutable. The language is small and simple, and the programs you create stay smaller and simpler than with most programming language environments. Still, perhaps Clojure’s super power is Interactive Programming. I.e. using the REPL to connect to, inspect, and modify the running program as you are developing it.

Läs mer »

VS Code runCommands for multi-commands keyboard shortcuts

Visual Studio Code has a command for stringing multiple commands together: runCommands. It’s designed to be used from keyboard shortcuts. Here’s an example:

Läs mer »

To ChatGPT a picture says more than a thousand words

One of the great usages I get from generative AI is to use it for checking that my messages come across as I want them to do. ChatGPT, Midjourney and their likes are trained from vast amounts of human communication. To note how they interpret something gets to be a measure on how it would be received by fellow human travelers. At least I contend it is so. Additionally I can “carve out”, with pretty good precision, the specific target group I want to reach with my article, picture, video, email, or whatnot.

Läs mer »

ImageMagick with Pango on MacOS Ventura

In ImageMagick + Pango + Babashka = ❤️ I told you about the Docker image cospaia/magick+pango+babashka, and that it allows for using Pango markup with ImageMagick locally as well as in CI. I also told you that I haven’t succeeded to install ImageMagic with Pango support on my Mac. Since I wrote that I have tried to figure it out, and when compiling ImageMagick from source failed in some opaque way, all too early in the make, I almost threw in the towel.

Läs mer »

ImageMagick + Pango + Babashka = ♥️

If you want to conveniently compose pictures and text programmatically you may want to have a look at ImageMagick. Especially when powered by Pango markup. The markup is SGML and the resulting text line breaks and flows automatically. It gets quite a lot easier to lay your text out this way, than to use ImageMagic’s built in text facilities. And some things do not only get easier, they become possible.

Läs mer »

Full source code: Newsletter automation using Buttondown + Google Sheets

Here’s how I created a fully automated, weekly newsletter using only RSS, Buttondown, and Google Sheets. Full source code included! I run a hobby project (Cospaia, mostly in Swedish, but it’s not important for this article) together with some friends. We wanted a weekly automated newsletter. When figuring out how to do this, I compared it to a commercial project I’m involved with, where we use Netlify Forms and Mailchimp, with Zapier as glue.

Läs mer »

The Stone Soup is a Lie

Some 20 years ago I worked at a startup with a CEO who liked to cook up various tricks to make potential customers think we were further ahead than we were. I complained that he was setting us and the customers up for failure. I suggested that at the next meeting we should be completely open and honest about what they would buy into. We could leverage it, even. We could tell the customers about the big opportunity to be part of, and shape, our journey.

Läs mer »