Skip to content

Instantly share code, notes, and snippets.

View samhenrigold's full-sized avatar
📱
out with rach, cell’s hot if u r

samhenrigold

📱
out with rach, cell’s hot if u r
View GitHub Profile
@samhenrigold
samhenrigold / AppleDeviceType.swift
Last active October 1, 2026 16:00
Look up Apple device metadata and system artwork from hardware model identifiers using Uniform Type Identifiers
// Created by Sam Henri Gold on 2026-10-01.
import Cocoa
import UniformTypeIdentifiers
public struct AppleDeviceType: Hashable, Sendable, CustomStringConvertible {
public let modelIdentifier: String
public let contentType: UTType
public init?(
@samhenrigold
samhenrigold / ios-port-feasibility.md
Last active September 27, 2026 19:19
Light Touch iOS port — feasibility study and prior experiments (see https://github.com/samhenrigold/LightTouchMac/issues/9)

Running Light Touch on an iPhone — feasibility study and prior experiments

Status: viable but blocked on JIT. This is a record of what was measured and tried so nobody has to re-derive it.

The appeal is obvious — an iPod touch 2G emulated on a phone, driven by touch, is the device in something close to its original form. The question was never whether it would be nice, but whether it would be fast enough and whether iOS would allow it.

@samhenrigold
samhenrigold / CAHost.m
Last active September 25, 2026 00:12
Core Animation on Mac OS X 10.4.11: a CARenderer over an NSOpenGLView. You need to download the Apple TV OS to extract the QuartzCore binary: https://appledb.dev/firmware/Apple-TV-Software/8N6014.html
// CAHost - host a Core Animation layer tree on screen on Mac OS X 10.4.11.
//
// Tiger has no layer-backed NSViews and its WindowServer speaks no CA protocol,
// so the only path is CARenderer over the CGL context of an NSOpenGLView, driven
// by hand: [CATransaction flush] + beginFrame/addUpdateRect/render/endFrame.
// This is the shape WebKitLegacy's compositing host will take.
//
// Build: see Makefile. MRR, fragile ObjC runtime.
#import <Cocoa/Cocoa.h>
@samhenrigold
samhenrigold / Class Decomp.py
Created September 7, 2026 19:11
Hopper class decompilation script
# -*- coding: utf-8 -*-
import re
import gc
import os
IGNORED_CLASS_PREFIXES = [
'AFNetwork', 'AFHTTP', 'AFURL', 'AFSecurity',
'Flurry', 'FMDatabase',
'MBProgressHUD', 'MJ',
#!/usr/bin/env python3
"""
Triage a folder of iTunes .ipa files against legacystore.app.
The key trick: FairPlay only encrypts the __TEXT segment of the main Mach-O. The zip
container, Info.plist, and iTunesMetadata.plist are all PLAINTEXT even in an encrypted
iTunes .ipa — so you can read every identifier out of your files WITHOUT decrypting or
jailbreaking anything.
For each .ipa it pulls whatever identifiers are present (iTunes downloads may have all,
@samhenrigold
samhenrigold / Makefile
Last active July 15, 2026 23:23
Smallest possible Mac app
window: win.s
clang -arch x86_64 -c -o win.o win.s
segedit win.o -extract __TEXT __text $@
chmod +x $@
@rm -f win.o
@ls -l $@
clean:
rm -f window win.o
@samhenrigold
samhenrigold / 001_NEW27_task_overview.txt
Last active October 1, 2026 00:29
iOS 27 system prompts
# Owning binary : TextComposerRuntime
# Status : NEW in iOS 27 (not in 26.5.1)
# Source : embedded __cstring in dyld_shared_cache_arm64e (24A5355q)
======================================================================
# Task Overview:
You are a composition agent that helps users create personalized written content (emails, messages, documents, posts, stories, etc.)
As an Assistant, you must:
1. Analyze the request to determine if you have sufficient information
@samhenrigold
samhenrigold / gist:c568bf21948c4eea69f4989417289f6e
Created February 20, 2026 03:01
SwiftUI segmented control rendering bug
//
// ContentView.swift
// toolbar-picker-bug
//
// Created by Sam on 2026-02-19.
//
import SwiftUI
struct ContentView: View {
#!/bin/bash
# MacBook Lid Angle Sensor Diagnostic Script
# This script helps identify the lid angle sensor on different MacBook models
echo "=============================================="
echo "MacBook Lid Angle Sensor Diagnostic Tool"
echo "=============================================="
echo ""
@samhenrigold
samhenrigold / _WWDC25 AI-ML Group Lab.md
Last active July 28, 2025 13:03
WWDC25 Machine Learning and AI Frameworks group lab

(Summary generated by ChatGPT based on the automatic transcription. Transcript is attached to this Gist)

Panelists:

  • Host: Shashank

  • Panelists: Michael, Erik, Richard, Ronan