Improving my elisp by building an API to my YOURLS shortener

Until recently I was well-served by now-derelict url-shortener which worked well. It’s a cool library – very general, supporting a variety of shortening options. But when it broke, it was annoyingly complex to fix. Plus, I needed the excuse to sharpen my elisp skills a bit. The result is below. I learned a lot of good things (big thanks to the Reddit emacs community), including: Using defcustom to create customs groups for use in emacs’ nice customization tooling Utilizing url-build-query-string to build my… well, you know.

gmail pop3 suddenly broken for getmail

For years I’ve been using pop3 to collect my gmails, without problem. However, since yesterday it is failing. I use getmail and have made no changes since originally getting it working. When I use getmail -vvv I get the following error: Retrieval error: server for SimplePOP3SSLRetriever:recent:«myaddress>@gmail.com@pop.gmail.com:995 is broken; offered message GmailId1718e4039279f0fe but failed to provide it. Please notify the administrator of the server. Skipping message… I don’t see any notification of recent changes, but my mail client is devoid of gmail functionality now.

Simulating `C-u` args to lambda-wrapped functions

I build hydras for common functions in my use-pattern; sometimes it’s the C-u version that I want in my hydra. Usually this is easily done by passing a '(4) to the function. However, I have one fn that is failing at this: ("<f11>" (lambda () (interactive) (flyspell-correct-wrapper '(4))) "spell correct") ;; eval: Wrong number of arguments: (0 . 0), 1 The reason for this failure is that it turns out emacs has two ways of calling fns with prefix args.

Leveraging Clojure-power for SQL generation with HoneySQL

One of the most meaningful testaments to Clojure’s data-driven and lisp-powered design is the ability to use it to refine any of its transpiling processes, here SQL generation (elsewhere route generation, CSS generation, and of course its actual hosted languages, including Javascript or Java generation*). In this post I was tasked with refactoring a 3-arg function that reads from the database into a map-taking function that works with one, two, or three items in the map.

Quickly Creating DB namespaces with shell, emacs, and init.sql

My project design includes creating a file/namespace for each database table, with a suite of CRUD operations applying to each table. The end result is that I have functions like db.my-table/CREATE, READ, UPDATE, and DELETE available for each table. The strategy is as follows: Establish the template clj file that has all your CRUD operations Obtain all table names (e.g. from init.sql) Use a script to create a matching clj file based on template (1) customized to refer to the tables from (2) 1.

My Garden CSS has ascended

I’ve been continually seeking the answer to Garden CSS’s title question: “what’s possible when you trade a preprocessor for a programming language?” I have used Garden exclusively for years, happily wielding garden-gnome to implement hot-loading on my front-end for an excellent development experience. Writing CSS with Clojure data-structures is a hands-down win over raw css-writing, and Garden also gives useful shortcuts that some of the preprocessors also have like lighten, darken, & selectors, and more.

Scratch buffer

I have been deep in emacs for over a decade but still never utilized the scratch buffer until I saw how much it was part of the workflow of a friend. I’ve now fixed may ways and just needed a fast way to open it, optionally in a side Window. I wrote up this quick command and bound it to a convenient hydra key and now I have one-stroke scratch buffer opening.

A Gotcha: test.core/thrown?

https://clojureverse.org/t/a-gotcha-test-core-thrown/5595/1 Clojure is generally such a pristine and sensible language, it took me some debugging time to find out why this was failing: (is (let [proctorless-rmap {:tester (:id tester) :test (:id this-test)}] (thrown? Exception (xreg/register-for-exam proctorless-rmap)) "no proctor should fail")) ;; Unable to resolve symbol: thrown? in this context Trying to solve this at the repl, I was stumped for quite a while by why I couldn’t locate the thrown? function with C-c C-.

Building custom x11 cursors for Linux

I wanted to use the sort of Starcraft game cursors I enjoyed on my windows machine as a teenager, and this was my first thought of custom cursors in Linux. Note that I use EXWM as a low-level window manager, so these instructions should work for most any Linux system. Spoiler: I got it working, but it took a good deal of time that I hope you might be saved. Here is my story.

making Hugo Homepage a post listing

With a recent hugo upgrade on my machine, suddenly all my front-pages were links to my “posts” section and only one click later would you see what had correctly been my homepage previously. I received no help on Reddit or on the themes (which, some of which, unfortunately, are no longer maintained), so did some studying and got it back to working. Here is hoping this helps solve your issue.