Hi, I'm Kris

Headshot image of Kris Carta
I'm a software nerd, and this is my space for exploring *everything* from tech to leadership. Have a comment? Hit me up on social media!

Navigation

Weekly update: 47/2024

This week, I've been:

  • Dipping my toes into Bluesky (it's great! Join us!),
  • Reading the 1999 classic "The Inmates are Running the Asylum", which not only insightfully revealed the obstacles to producing software that accommodates its users goals, but put forward foundational principles for Interaction Design that still hold today,
  • Confirming my own sad observations about the shocking lack of 'true nature' in Denmark,
  • Re-watching Heat (1995), my all-time favorite action movie not set in an Australian wasteland,
  • Grooving to the legendary Kim Deal's new album, full of stellar tracks and that inimitable blend of fuzz and hooks that only she seems to be able to land consistently.

Life & perspective

Baby-life has been tough this week, and getting in the way of progress on my follow-ups to My initial post on RAD with GenAI/LLMs. It is exhilirating to finally be putting words to the thoughts that have been rolling around in my head for years, but as could be expected, this also makes it hard to stay focused on one point at a time. But progress is being made, slowly and steadily.

As a follow-up to my admitted bout of impostor syndrome in last week's post, I had a thought: the counter to this despondence is something I practice in my work, when applying 'agile' principles in a delivery. Overcoming insecurity requires awareness & perspective (i.e. what is the actual situation I'm in?), measurement (i.e. what have I been doing/producing?), clear goals, and then steering & negotiation (i.e. what levers can I pull?, will that effectivize progress towards my goal, is it feasible, sustainable, ...?). Taking this reality-check with myself has helped, and I am relieved to remember that I have a clear direction, am making visible progress towards it, and that I am progressing as much as could be expected given the context I'm in. Phew 😌

Emacs nerd dump

Lastly, I want to nerd a bit with a sneak-peek of an upcoming post, where I gush about how Emacs has rejuvenated my passion for extensible text editors - born in 2013 when I fell for Vim (hard - I would walk around with printouts of Vim keybindings folded up in my pocket), and lost ca. 2019 when I started using VS Code by default like most everyone else.

The key quality of Emacs is its extensibility. Customizing Emacs isn't something done in a settings menu or a limited JSON file as in modern editors, in Emacs the entire editor is at all times completely open to you as a user. All you need is to grok its simple Lisp dialect. This makes it natural to extend Emacs with features, often on-demand as you come up with ideas.

Recently, while working on this blog, I had two pains:

  • Remembering the 'front matter' format is hard, and I tire of copy-pasting from past files.
  • Linking to existing posts requires too much, that I remember a syntax, a command, and the exact name of the post I want to link to.

Both were 'solved' with a new function each, which I whipped up, evaluated on-the-fly, and added into my config for future sessions, in under 2 minutes for each!

The first was simple and took just a minute of remembering the syntax:

(defun jekyll-insert-top-matter ()
  "Insert Jekyll top matter at point."
  (interactive)
  (let ((current-date (format-time-string "%Y-%m-%d")))
    (insert (format "---
layout: post
title:  \"Title goes here\"
date:   %s 00:00:00 +0000
tags: []
---\n" current-date))))

The second was more complex, and to keep from spending more than a minute-or-two on this, I had Claude help me work through some of the necessary commands:

;; As-generated by Claude AI and not thoroughly tested, use at your own risk!
(defun jekyll-insert-post-link (filename link-text)
  "Insert link to other post in Jekyll blog."
  (interactive
   (list
    (let ((posts-dir (expand-file-name "_posts" (locate-dominating-file default-directory "_posts"))))
      (if (and (eq major-mode 'dired-mode)
               (region-active-p))
          ;; If in dired with active region, use selected filename
          (file-name-sans-extension
           (file-name-nondirectory
            (dired-get-filename)))
        ;; Otherwise prompt with completion
        (let* ((files (and (file-exists-p posts-dir)
                          (directory-files posts-dir nil "^[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}-.*\\.\\(md\\|markdown\\)$")))
               (names (mapcar #'file-name-sans-extension files)))
          (completing-read "Post file: " names nil t))))
    ;; Get link text from region or prompt
    (if (and (not (eq major-mode 'dired-mode))
             (region-active-p))
        (buffer-substring-no-properties (region-beginning) (region-end))
      (read-string "Link text: "))))
  
  ;; Delete region if it was active (in markdown-mode)
  (when (and (not (eq major-mode 'dired-mode))
             (region-active-p))
    (delete-region (region-beginning) (region-end)))
  
  ;; Insert the formatted markdown link
  (insert "[" link-text "](" "{% post_url " filename " %}" ")"))

(I'm sure this might be simplified with better use of available functions, but I can understand the code & see that it works, and that's enough for my purposes!)

The result - commands I can call at any time, built into my editor!

Emacs commands