Skip to content

Instantly share code, notes, and snippets.

View majick's full-sized avatar
🖕
Giving up on GitHub and Gitlab

majick

🖕
Giving up on GitHub and Gitlab
View GitHub Profile
@majick
majick / uninstall-macos-package
Created August 25, 2025 16:18
uninstall macOS packages safely
#!/bin/bash
# safely and noiselessly uninstall macos packages
#
# to see packages installed:
# pkgutil --pkgs
rmdir-if-exist() {
# ghetto only first parameter
[[ -d "$1" ]] && sudo rmdir --ignore-fail-on-non-empty "$1"
@majick
majick / appify
Created August 23, 2025 16:49 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@majick
majick / macos_launch.command
Created July 5, 2025 02:57
macOS command file to run DOSBox Staging on a particular DOS program
#!/bin/sh
# Yes, POSIX shell. Because I said so.
#
# Example: run Wing Commander 1 launcher
COMMAND="LAUNCHER.BAT"
MYDIR=$(dirname -- $0)
nohup /Applications/DOSBox\ Staging.app/Contents/MacOS/dosbox -exit ${MYDIR}/${COMMAND} 2> /dev/null > /dev/null &
@majick
majick / shellscript.command
Created July 5, 2025 02:48
Run a single-shot .command file on macOS without ugly Terminal bullshit
#!/bin/sh
#
nohup [DO_WHATEVER_YOU_WANT_HERE] 2> /dev/null > /dev/null &
# The magic incantation to:
# a. Make Terminal willing to close windows
# b. Quit the terminal after this .command file runs
# c. Get rid of Terminal from the Recent Apps list (because nobody runs Terminal)
#
@majick
majick / drive.setup.patch.guide.v1.08.txt
Created February 18, 2025 17:51
"Drive Setup Patch Guide" for Mac OS / The lost FAQ
[Editor's note: This FAQ, which was helpful to others decades later
for fixing up vintage Macs, was lost when the home page of the dude
who wrote it went away. There's an unreadable copy on the Internet
Archive, which I have rendered readable here.]
Drive Setup Patch Guide
-----------------------
v1.08 [02/2000]
The purpose of this guide is to explain how Apple's Drive Setup can be
used to format non-Apple hard disks. It is organized in a step by step