A Lesson in the Beauty of Data - XML Parsing on the Front End: to CLJS or not to CLJS?

The task came that I need to parse some XML in a front-only app. In a sense, browsers are just big XML (≅ HTML) processors, so embracing the Clojure principle of being a hosted language, it seemed desirable to utilize the built-in power of my browser. This effort turned out to be a rabbit hole, though. Consider the following: A Native Approach (let [s "<title>Tech.ToryAnderson.com</title>" ;; 1 p (js/DOMParser.) ;; 2 doc (.

Colorize chmod strings in dired

How do I colorize the chmod privileges string? I am using dired+ and dired-hacks and have the ability to colorize the FILES based on the chmod string, but I want the string itself to have colors. I had this a little bit ago but somehow it went away. For example, each column in so that the eye can follow the colors down and easily see permission differences within a directory.

Customizing a Font-Face (dired directories)

I sensed I could improve how my directories appeared in dired, instead of just being bold-face. The question was, how to find which face to change to get the desired result? Digging through my customize-faces options was tedious and sometimes misses the tree for the forest unless you know which one you’re looking for. Locating the face at point Enter the beautiful self-documenting nature of Emacs. Put your cursor on the thing you want to change (remember, our whole philosophy emacs inherited from *Nix is that everything is text).

Locating the face at point

Enter the beautiful self-documenting nature of Emacs. Put your cursor on the thing you want to change (remember, our whole philosophy emacs inherited from *Nix is that everything is text). Then do C-u C-x = (what-cursor-position) and you’ll get a buffer telling you more than you wanted to know about the text you’re on top of. For us, we just want to know the faces at hand; give them a search and then you’ll know just which to change in customize-face.

Fine-grained per-method middleware use with Reitit

Fact: I have middleware performing authentication (in this case, my CAS authentication middleware) Need: This middleware should apply to client-facing SPA-rendered views, which are requested via GET. Constraint: This middleware does NOT apply to non-get routes (which are headless so the authentication must be handled differently) Constraint: There exist headless GET routes, too, which should not be CAS authenticated Constraint: Individual routes may have a CAS-authenticated GET response, as well as non-CAS POST, PATCH, and DELETE responses Reitit allowed me to specify middleware on a delightfully granular level to solve this.

Deploying to Clojars with the new tokens

With a recent, well-deserved funding round to the Clojars repository project, the password you log in to the site with is no longer valid as the password with which you publish deployments. See https://github.com/clojars/clojars-web/wiki/Deploy-Tokens and https://clojars.org/tokens . The annoyingly unanswered question is how I adjust my setup to USE the token. So, here it is with Leiningen. Project.clj I have the following in my project.clj, which is the same as I had before switching from my web password to the token:

Deploying to Clojars with the new tokens :clojure: clojars: deployment: token: leinengen: credentials:

With a recent, well-deserved funding round to the Clojars respository project, the password you log in to the site with is no longer valid as the password with which you publish deployments. See https://github.com/clojars/clojars-web/wiki/Deploy-Tokens and https://clojars.org/tokens . The annoyingly unsanswered question is how I adjust my setup to USE the token. So, here it is with Leinengen. Project.clj I have the following in my project.clj, which is the same as I had before switching from my web password to the token:

Missing font for insert-character utf8 characters?

Question When I do insert-char (C-x 8 RET) I get lots of “no character” font displays, as when I seek characters matching “smil”. Can I fix this without rebuilding emacs? Answer Solved by following https://github.com/rolandwalker/unicode-fonts. Just put the .ttf files in my ~/.fonts dir, and where the repo links were broken I was able to download the font from google fonts. Didn’t even have to restart my emacs. Thread https://www.

Critique my org elisp

Someday I’ll get around to writing about code quality in elisp, but for now I don’t know it well enough to know idioms and avoid code-smell. Orgmode has a massive code-base and the documentation has a hard-time keeping up, so I asked, How is the following code, aimed at getting the list of header tags and making them into a comma-separated string? org-get-tags didn’t work because I needed to support when the cursor is in the text of an entry, not just on the headline.

Emacs Tip: Registers

The Simple Genius of Emacs Registers It’s been in emacs since the beginning, and is not had in many other editors, yet many people don’t know about it. Registers. The documentation talks about many types, most of which I haven’t tried yet. The three I use the most, however, are: Text in register. Suppose I want a chunk of text but am doing something that will pollute my kill ring, so I can’t just yank (paste) every time.