Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Wowfunhappy / macports-libcxx-llvm18.patch
Created August 22, 2025 18:17
macports-libcxx + llvm 18 (on Mavericks)
# Updates macports-libcxx to to support C++20.
diff --git a/lang/macports-libcxx/Portfile b/lang/macports-libcxx/Portfile
index 2648853..f152a2a 100644
--- a/lang/macports-libcxx/Portfile
+++ b/lang/macports-libcxx/Portfile
@@ -16,10 +16,10 @@ long_description This port installs a recent libc++ from llvm \
# for now, we will leverage the already-built libc++ in the appropriate clang port
# later, we can build this independently if we choose to do so, much like libtapi
@Wowfunhappy
Wowfunhappy / mavericks_help_downloader
Last active June 27, 2025 16:40
Download OS X Mavericks Help Viewer Content
#!/usr/bin/env python3
"""
This script downloads and saves an offline copy of any Mavericks (10.9) Apple Help documentation.
It creates a directory structure identical to the original help system.
"""
import os
import re
import json
import requests
@Wowfunhappy
Wowfunhappy / main.m
Created April 28, 2025 21:40
Reveal Current Desktop Picture In Finder
// Build with compiler flag `-lsqlite3`.
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <sqlite3.h>
NSString *getDesktopImagePath() {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *imageURL = [[NSWorkspace sharedWorkspace] desktopImageURLForScreen:[NSScreen mainScreen]];
@Wowfunhappy
Wowfunhappy / gist:0e21294a528c370120060e1115dd581f
Created March 13, 2025 14:24
Add ISRG Root X1 certificate to legacy macOS
# One-line Terminal command to add the ISRG Root X1 certificate to old versions of macOS / OS X.
# Run this command while connected to the internet via a trustworthy source.
# An example of a trustworthy source would (probably) be a password-protected home WiFi network.
# An example of an untrustedworthy source would be the public WiFi at your local coffee shop.
curl 'http://x1.i.lencr.org' > /tmp/ISRGRootX1.pem && sudo security -v add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/ISRGRootX1.pem
@Wowfunhappy
Wowfunhappy / download-mavericks.sh
Last active September 14, 2025 02:45
Download a Mac OS X 10.9 Mavericks installer image Apple
#!/bin/sh
# Download script written by Wowfunhappy. Last updated 2025/06/15.
# Thank you to Krackers, Jazzzny, and others for helping analyze Apple's download process and debug this script.
# Thank you to dosdude1 for donating identifiers from a broken Mac.
# Any mistakes are mine alone.
# Helper functions
@Wowfunhappy
Wowfunhappy / main.m
Last active May 6, 2025 02:15
Firefox Key Equivalent Fixer
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "ZKSwizzle.h"
@interface myNSApplication : NSApplication
@end
@Wowfunhappy
Wowfunhappy / gist:ab459b4bf7c070f31300894c42c427a4
Last active May 27, 2024 16:26
Build Ship of Harkinian for Mac OS X 10.9
Last used with this commit: https://github.com/HarbourMasters/Shipwright/commit/ad0e17383e72c652541e6a90367ab720c6a18723
1. sudo port install libsdl2 libpng glew ninja cmake libzip nlohmann-json boost legacy-support clang-17 macports-libcxx tinyxml2
2. git clone --recursive https://github.com/HarbourMasters/Shipwright.git
@Wowfunhappy
Wowfunhappy / Part 1.py
Created January 23, 2024 22:47
Advent of Code 2022 Day 3
input = open("input.txt")
rucksacks = input.readlines()
commonItems = []
def findCommonItem(compartmentA, compartmentB):
for i in range(0, len(compartmentA)):
for j in range(0, len(compartmentB)):
if (compartmentA[i] == compartmentB[j]):
return compartmentA[i]
import itertools
import random
import time
import re
MAX_EXPONENT = 5
solutionList = []
#Based on https://theconfused.me/blog/solving-the-24-game/
def solve(numbers, expr=[]):
@Wowfunhappy
Wowfunhappy / Info.plist
Last active June 15, 2025 17:24
KQueueScanContinuePatch
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>wowfunhappy.$(PRODUCT_NAME:rfc1034identifier)</string>