Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

  • Milwaukee, WI
View GitHub Profile
@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

@mcandre
mcandre / the-man.md
Created April 24, 2025 23:47
The Man

The Man

When the man comes for your device, activate the corresponding sequence to disable biometrics. Legally, that makes it more cumbersome for them to steal your data.

iOS

  1. Press the power button five times in rapid succession.

macOS

@mcandre
mcandre / trading-card-game-format-archetypes.md
Last active April 20, 2025 05:59
Trading Card Game Format Archetypes

Trading Card Game Format Archetypes

Introduction

Like a deck of Poker playing cards, trading card game's (TCG's) can be enjoyed in multiple ways, by applying different rulesets (formats).

TCG formats come in two main varieties: Constructed and Limited.

Broadly speaking, players bring preassembled decks to Constructed events, whereas in Limited formats they assemble a fresh deck from a pool of cards.