Sign in

Michael Kohl

@citizen428.net
137 followers 187 following 318 posts

Your friendly neighborhood anarcho-cynicalist. I do things with computers and occasionally succeed. 🇦🇹 in 🇹🇭 since 2013. Fan of 1990s pop culture. I delete old posts. I'm more active on Mastodon: chaos.social/@citizen428

PostsRepliesMedia
Michael Kohl @citizen428.net · 04/09/2026
Hm, I never noticed the --numstat flag in git diff before. It shows you the lines added and removed for every file in the diff. #git
git diff --numstat showing the output for a list of files:

220     264     src/path/omitted1
240     316     src/path/omitted2
128     161     src/path/omitted3
132     157     src/path/omitted4
1       1       src/path/omitted5
000
Michael Kohl @citizen428.net · 03/09/2026
Still looking at log files with tail -f? There's a better way to do this in #emacs : 1. Open the log file. 2. Make sure auto-revert-mode is enabled.
A screenshot of an Emacs frame. The user color theme is modus-operandi-tinted. There's a vertical split. The left window contains a ghostel buffer adding log entries to a dummy log file, the right window shows the buffer with some warn and error highlighted with the highlight-phrase function.
220
Michael Kohl @citizen428.net · 12/07/2026
A few months ago our #dog learned a new life hack: if either my wife or I are not in the room when he gets his food, he’ll finish the bowl and then go to the other person and pretend he didn’t get fed yet. 😂 🐕 #dogsofmastodon
A senior German Shepherd mix doing his best “I’m starving, surely you can’t let this happen” face.
020
Michael Kohl @citizen428.net · 18/05/2026
Even in high-level languages, it can pay off to understand how CPUs work. In about half an hour today (no AI), I hacked together a naive #ruby SoA class, which introspects on a `Data` or `Struct` class and generates an appropriate SoA wrapper from it.
An example showing how to create a SOA class for an existing Data or Struct class. The Ruby code:

Measurement = Data.define(:value, :unit)
MeasurementSOA = SOA.for(Measurement)
measurements = MeasurementSOA.newA screenshot showing the results of a Ruby benchmark run. The actual data for both runs is 

                           user     system      total        real
AoS avg:               0.050274   0.000110   0.050384 (  0.050396)
SoA avg:               0.001582   0.000001   0.001583 (  0.001583)
100
Michael Kohl @citizen428.net · 27/04/2026
All the vibecoders after the recent Claude Opus 4.7 regressions 😈
A version of the "Friendship ended with Mudasir" meme, saying "Friendship ended with Claude, now Codex is my best friend"

https://knowyourmeme.com/memes/friendship-ended-with-mudasir
012
Michael Kohl @citizen428.net · 26/02/2026
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should. #c #programming
An xkcd coming:

Cueball: I have an idea!
Megan: Is it bad?
Cueball: Extremely.C source code screenshot showing the following:

#define WATER_CSS "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"

#define HTML                                                              \
  head(                                                                   \
    tag(title, C Preprocessor Abuse)                                      \
    link(_(rel="stylesheet" href=WATER_CSS))                              \
  )                                                                       \
  body(                                                                   \
    div(attr(class, "container"),                                         \
      h1(, C Preprocessor Abuse)                                          \
      hr                                                                  \
      p(, This page was generated entirely by the C preprocessor.)        \
      p(, HTML tags are defined as function-like macros that expand to    \
          angle-bracket syntax. The entire page is a single string        \
          literal assembled at compile time via token stringification.)   \
      tag(blockquote, tag(em, The compiler is the template engine.))      \
      hr                                                                  \
    )                                                                     \
  )A screenshot of the rendered HTML, showing teh following text:

C Preprocessor Abuse
This page was generated entirely by the C preprocessor.

HTML tags are defined as function-like macros that expand to angle-bracket syntax. The entire page is a single string literal assembled at compile time via token stringification.

The compiler is the template engine.
110
Michael Kohl @citizen428.net · 13/02/2026
Recently got reminded of cdecl.org , a site for translating from "C gibberish" to English. Here's the almost classic example of the `signal` function from `signal.h`. #programming #c
An image of cdecl in action. The input is the following signature:

void (*signal(int, void (*)(int)))(int);

The output is "declare signal as function (int, pointer to function (int) returning void) returning pointer to function (int) returning void:
000
Michael Kohl @citizen428.net · 03/02/2026
My wife told the dog that “daddy is coming home.” He got a bit excited, so worke her up at 1:26 AM wondering if it’s time to go to the airport. ❤️
A German Shepherd mix sitting next to a bed, staring at the no longer sleeping person in it (person not visible in photo.)
000
Michael Kohl @citizen428.net · 25/01/2026
One perk of living in the tropics: we have a banana tree in the garden and the bananas are really good.
A bunch of about 20 bananas from our garden.
010
Michael Kohl @citizen428.net · 19/01/2026
The dog is not allowed in the kitchen (in general a rule with very poor enforcement) but he’s very determined to test our border security.
A sad looking German Shepherd mix lying on the floor, stretching his front legs into the forbidden place of delicious smells.
010
Michael Kohl @citizen428.net · 19/01/2026
Monday morning mood.
Meme showing Jesus partaking in some 420 [1] with the text 'Flood It Again'. 

[1] Like Bill Clinton he did not inhale.
031
Michael Kohl @citizen428.net · 06/01/2026
Occasionally, people new to #gleam get confused by the `use` expression. During a recent Discord discussion, I created a color-coded graphic that helped clarify it for one user. I thought I'd share it here as well—it might help others too. tour.gleam.run/advanced-features/use
A screenshot of a color-coded desugaring of the following use expression:

use x <- some_fun(42) x * x

The desugared form is 

some_fun(42, fn(x) { x * x })

In both cases the x is light green (variable binding), 42 is light blue (argument), some_fun is yellow (function name) and the expression "x * x" is purple (callback body).

There's also a textual description:

How it works: The use expression takes everything after it and wraps it in an anonymous function fn(x) {... }, which is then passed as the final argument to the function on the right-hand side of <-. This eliminates callback nesting without adding language complexity!
020
Michael Kohl @citizen428.net · 23/11/2025
When I have to use VSCode for some reason or another, I trigger `gitu` via `Alt-x g` in terminal editor split to the right.
A screenshot of the VSCode key binding:

  {
    "key": "alt+x g",
    "command": "runCommands",
    "args": {
      "commands": [
        "workbench.action.splitEditorRight",
        "workbench.action.createTerminalEditor",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "gitu\n" }
        }
      ]
    }
  }
000
Michael Kohl @citizen428.net · 23/11/2025
One underrated — at least IMO — tmux feature are popups. For example, I have `Ctrl-a g` mapped to open a `gitu` [1] popup with a 90% window size. Once I'm done, the popup will just automatically close and I'm back at my regular terminal window.
Screenshot of the gitu git interface as a tmux popup. gitu is showing one unstaged change to tmux.conf, a list of recent commits, and a keyboard shortcuts help menu at the bottom.
110
Michael Kohl @citizen428.net · 21/11/2025
Most times I try to use an LLM for coding, the experience can be summed up as "Old man yells at Claude".
An image of the TV show "The Simpsons". It shows a newspaper clipping with the headline "Old Man Yell at Cloud". It also shows a picture of Grandpa Simpson yelling and shaking his fist a single white cloud in a blue sky.
000
Michael Kohl @citizen428.net · 31/10/2025
Consistently being able to quickly output an image in the terminal turns out to be a major headache for people who use different terminal emulators on different systems. This zsh function is my current best attempt (code in alt text). #terminal #productivity
A screenshot of the following ZSH function:

function imgcat() {
  if [[ -n "$KITTY_OS" ]]; then
    # https://sw.kovidgoyal.net/kitty/kittens/icat/
    kitten icat "$1"
  elif [[ -n "$WEZTERM_PANE" ]]; then
    # https://wezterm.org/imgcat.html
    wezterm imgcat "$1"
  elif [[ -n "$ITERM_SESSION_ID" ]]; then
    # https://iterm2.com/documentation-images.html, through timg
    timg -pi "$1"
  elif [[ -n "$GHOSTTY_RESOURCES_DIR" ]]; then
    # Ghostty uses Kitty's protocol, which timg can output
    timg -pk "$1"
  else
    # If all else fails, try sixel
    timg -ps "$1"
  fi
}
010
Michael Kohl @citizen428.net · 29/10/2025
I like consistent colors in my terminal, and I like #OCaml, so I threw together a quick Nord color scheme for utop: git.sr.ht/~citizen428/nord-utop
The following example code in a utop session show in the Nord colorscheme.

# let rec sum = function
| [] -> 0
| hd :: tl -> hd + sum tl;;
val sum : int list -> int = <fun>
# #show sum;;
val sum : int list -> int
# "Hello, " ^ "OCaml " ^ "World!";;
- : string = "Hello, OCaml World!"
# 1/0;;
Exception: Division_by_zero.
# 1 + "string";;
Error: This constant has type string but an expression was expected of type int
172
Michael Kohl @citizen428.net · 07/10/2025
Finalized the schedule for RubyConf Thailand 2026. It's not online yet, unfortunately, but that's someone else's job. 😈 rubyconfth.com #ruby #RubyConfTH
Three-panel Sailor Moon meme: Tuxedo Mask dramatically declares "My job here is done" and swooshes his cape. Sailor Moon responds "But you didn't do anything." The final panel shows Tuxedo Mask vanishing into the darkness.
000
Michael Kohl @citizen428.net · 01/10/2025
JOMO [dʒōmō] noun

Joy Of Missing Out; feeling content with staying in and disconnecting as a form of self-care.
010