Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

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

@mcandre
mcandre / macos-startup-items.md
Last active April 21, 2025 02:13
macOS Startup Items

macOS Startup Items

macOS relies too much on applications to manage their own startup item configuration. Over time, this leads to vestigial entries building up in startup items.

Gather data on startup items

Both System Settings and launchctl stink at startup item management.

One of the key features lacking in macOS is GUI + CLI options to query startup items by the very name listed in the Login Items & Extensions pane. This overcomplicates basic cleanup operations, and makes it easier for malware to hide.

@mcandre
mcandre / go-update-tool-dependencies.md
Created April 18, 2025 04:41
Go Update (Tool) Dependencies

Go Update Tool Dependencies

$ go get -u all
$ go mod download; go mod vendor; go mod tidy
@mcandre
mcandre / git-checkout-remote-refs.md
Last active April 28, 2025 01:31
git checkout remote refs

git checkout remote refs

$ git fetch [--all]
$ git checkout -b <branch> --track <remote>/<ref>

Where ref is a commit, tag, or branch.

Thereafter use ordinary git checkout commands to select between local branches.

@mcandre
mcandre / SemExit.md
Last active April 12, 2025 22:29
SemExit

SemExit: Semantic Exit Codes for Command Line Interface Processes

MOTIVATION

Standardize Command Line Interface (CLI) program exit code semantics similar to Web response statuses, towards an ecosystem of more intuitive, scriptable, and CI/CD friendly terminal applications.

INTRODUCTION

Unlike modern REST apps, CLI program behavior has continued to vary in the extreme. Simply checking whether a child process succeeds vs. fails from the parent is often a complicated affair, involving tons of error handling logic specific to that particular child command, and all too often involving flaky stdout/stderr log parsing as well.

@mcandre
mcandre / go-register-tools.md
Last active February 11, 2025 23:27
Go Register Tools

Go Register Tools

Go tools with pinned versions can now be tracked with the go mod system.

$ go get -tool <package>

This adds tool dependency entries in go.mod. Then update the go mod cache:

@mcandre
mcandre / lorcana-deckbuilding.md
Last active December 24, 2024 03:32
Lorcana Deckbuilding

Lorcana Deckbuilding

REQUIREMENTS

  • Minimum 60 cards †
  • Maximum 2 colors
  • Maximum 4 copies of each card that shares the exact title and subtitle name

RECOMMENDATIONS