Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

  • Milwaukee, WI
View GitHub Profile
@mcandre
mcandre / accelerate-zsh.md
Created November 28, 2025 06:58
Accelerate zsh

Accelerate zsh

  1. Temporarily enclose your ~/.zshrc file with benchmark instructions:
zmodload zsh/zprof
...
zprof
@mcandre
mcandre / .tool-versions
Last active November 20, 2025 16:54
ComfyUI Background Service
# asdf
# https://asdf-vm.com/
#
# ~/nfsshare/.tool-versions
python 3.14.0
@mcandre
mcandre / rune-preservation-in-pagers.md
Last active October 29, 2025 21:42
Rune Preservation in Pagers

Rune Preservation in Pagers

Most pager applications, including more, less, ov, and eless, corrupt hard tabs to spaces. Consequently, they may break common copy & paste workflows for Go, make, and other indentation sensitive languages.

Alternatives to Consider

Some alternatives exist.

Configure an environment variable PAGER=<command> with the desired pager command. Many applications, such as git, invoke pagers this way.

@mcandre
mcandre / fix-brave-mailto-uri-registration.md
Created October 21, 2025 18:22
Fix Brave mailto: URI Registration

Fix Brave mailto: URI Registration

When registering URI handlers, Brave's configuration system often corrupts. Various hyperlinks may misbehave.

To fix this horrid computer state, pop open the hood and ensure that the pipes are fully connected to the right parts:

  1. Navigate to brave://settings/handlers.
  2. Set the desired platforms as the default handlers, such as Proton Mail for email mailto URI's.
@mcandre
mcandre / vscode-disable-ai.md
Created August 22, 2025 16:33
VSCode Disable AI

VSCode Disable AI

macOS

Command + Shift + P, Chat: Hide AI Features, Return

Windows, UNIX

Control + Shift + P, Chat: Hide AI Features, Enter

@mcandre
mcandre / ios-disable-split-screen.md
Created August 10, 2025 00:43
iOS Disable Split Screen

iOS Disable Split Screen

Navigate to Settings -> Accessibility -> Touch and set Reachability to off. Now your iPhone will stop randomly yanking the entire screen halfway down the device when using various gestures in the vicinity of the bottom of the screen.

@mcandre
mcandre / ffmpeg-merge-streams.md
Last active July 11, 2025 22:00
ffmpeg merge streams

ffmpeg merge streams

  1. Write an ffmpeg input configuration file list.txt of the form:
file '<input-1>'
file '<input-2>'
file '<input-3>'
...
@mcandre
mcandre / macos-toggle-keyboard-function-keys.md
Created June 25, 2025 20:49
macOS Toggle Keyboard Function Keys

macOS Toggle Keyboard Function Keys

Apple does not make it easy to very rapidly toggle between the two F1 - F12 vs. Brightness - Volume Up keyboard modes.

Fortunately, this can be automated via the Shortcuts scripting system.

Run Shell Script

defaults write -g com.apple.keyboard.fnState -int $(( ! "$(defaults read -g com.apple.keyboard.fnState -int)" ))
@mcandre
mcandre / macos-fix-network-file-corruption.md
Created May 23, 2025 06:30
macOS Fix Network File Corruption

macOS Fix Network File Corruption

macOS' SMB implementation is buggy, corrupting images when viewed with Preview.app.

As a workaround, select a different protocol, such as NFS.

@mcandre
mcandre / go-fuzzing.md
Last active May 15, 2025 20:47
go fuzzing

go fuzzing

What is fuzzing?

The gold standard of software testing is formal verification, a mathematical proof that a body of code cannot fail with unspecified behavior. However, in practice formal verification proceeds at a slower pace than many teams prefer to operate. Fortunately, we have a productive compromise: Fuzzing.

Fuzzing significantly raises the quality bar of software components, closing subtle testing gaps that other approaches neglect to address. For example, validation, a handful of manual tests, and code coverage will still leave latent bugs in very many codebases. This is because the input/state space is many orders of magnitude larger than the number of lines of code, and scale exponentially with the bit width and number of variables.

Fuzzing is able to identify these kinds of bugs, by generating random test cases to more comprehensively evaluate the input and/or state space. Code coverage won't tell you when you have a division by zero bug, or a nil pointer bug, or an empty array