Skip to content

Instantly share code, notes, and snippets.

View Integralist's full-sized avatar
🎯
Making an impact

Mark McDonnell Integralist

🎯
Making an impact
View GitHub Profile
@Integralist
Integralist / git pathspec exclusions.bash
Last active December 1, 2026 11:19
git pathspec exclusions
# $ which gd
# gd: aliased to hunk diff
gd -- . ':!.agents/skills'
# $ which gst
# gst: aliased to git st --short
# `st` is just an alias to `status`
gst -- . ':!.agents/skills'
@Integralist
Integralist / YouTube Music.md
Created November 29, 2026 09:23
Add metadata to flac audio files for YouTube Music upload

With brew install flac you'll get metaflac installed (/opt/homebrew/bin/metaflac). It is the native FLAC tool and modifies metadata in place without re-encoding the audio.

1. Embed album cover art

Place your cover image as cover.jpg (ideally a square JPEG between 500x500 and 1400x1400) inside the album directory:

cd ~/Music/"Dusk and Her Embrace"
metaflac --import-picture-from="cover.jpg" *.flac
@Integralist
Integralist / []T vs []*T and Cache Locality in Go.md
Created November 13, 2026 18:52
[]T vs []*T and Cache Locality in Go

[]T vs []*T and Cache Locality in Go

"Cache locality" is one of those terms that's easy to repeat and hard to develop an intuition for.

The claim that "[]*T is bad" is an oversimplification. It depends on how you're using it.

First, what is cache locality?

Modern CPUs don't fetch memory one byte at a time. They fetch cache lines, typically 64 bytes at once.

@Integralist
Integralist / hunk-ignore-files.bash
Last active October 28, 2026 11:06
hunk ignore files
# ignore changes to the local .agents/ and docs/ directories + ignore *.lock files
hunk diff -- . ':!.agents' ':!docs/' ':!*.lock'
# https://www.hunk.dev/
# https://github.com/modem-dev/hunk
@Integralist
Integralist / synctest example.md
Created October 21, 2026 14:22
Go synctest example

Here is an example with two concurrent background workers sleeping for different durations, observed by the main test goroutine.

package worker_test

import (
	"testing"
	"testing/synctest"
	"time"
)
@Integralist
Integralist / cd-rip.sh
Created October 16, 2026 14:11
CD Rip
mkdir -p ~/Music/Dusk_And_Her_Embrace && for f in "/Volumes/Dusk... And Her Embrace/"*.aiff; do ffmpeg -i "$f" -c:a flac -compression_level 12 ~/Music/Dusk_And_Her_Embrace/"$(basename "${f%.aiff}").flac"; done
@Integralist
Integralist / Mermaid Diagrams CLI.sh
Created August 28, 2026 13:23
Mermaid Diagrams CLI
npm install --global @mermaid-js/mermaid-cli
# -s is the scale (i.e. larger dimensions)
mmdc -i input.mmd -o output.png -b white -s 2
@Integralist
Integralist / Common Table Expressions.md
Last active June 10, 2026 09:23
MySQL Database: Core Fundamentals & Common Gotchas

Common Table Expressions

A Common Table Expression (CTE) in MySQL is a temporary result set that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement.

Think of it as a temporary view that exists only for the duration of that single query. It allows you to write cleaner, more readable SQL by breaking down complex queries into smaller, modular building blocks.

CTEs were introduced in MySQL 8.0, so you will need that version or higher to use them.

The Basic Syntax

@Integralist
Integralist / Kubernetes Probes.md
Created June 1, 2026 16:44
Kubernetes Probes
  • livenessProbe: tells Kubernetes whether the container is still alive. If it fails repeatedly, Kubernetes restarts the container.
  • readinessProbe: tells Kubernetes whether the container is ready to receive traffic. If it fails, the pod stays running but is removed from Service load balancing.
  • startupProbe: tells Kubernetes whether the app has finished starting up. While it is still failing, Kubernetes suppresses liveness/readiness handling for slow-starting apps.

Typical behavior:

  • Use livenessProbe to detect deadlocks/hung processes.
  • Use readinessProbe to gate traffic until dependencies/init work are done.
  • Use startupProbe when startup is slow and you don’t want liveness to kill the app too early.

Simple mental model:

@Integralist
Integralist / go-test-flags-summary.md
Last active May 24, 2026 13:26
Go: Discoverable Test Config in Go with Flags (rednafi.com)

Discoverable Test Config in Go: Use Flags

Summary of rednafi.com/go/test-config-with-flags.

The article compares three ways to toggle tests in Go (snapshot, integration, real-vs-mock) and argues for custom flags.

1. Build tags — discouraged

//go:build snapshot