Skip to content

Instantly share code, notes, and snippets.

Steven Troughton-Smith steventroughtonsmith

Block or report user

Report or block steventroughtonsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steventroughtonsmith
steventroughtonsmith / UIView+Tooltips.h
Last active Sep 18, 2019
WIP tooltips for Mac Catalyst
View UIView+Tooltips.h
//
// UIView+Tooltips.h
// Crossword
//
// Created by Steven Troughton-Smith on 13/09/2019.
// Copyright © 2019 Steven Troughton-Smith. All rights reserved.
//
#import <UIKit/UIKit.h>
@steventroughtonsmith
steventroughtonsmith / bitcode2intel
Created May 18, 2019
Converts an ARM64 iOS app with Bitcode into an X86_64 variant
View bitcode2intel
#!/bin/bash
TARGET="$( cd "$(dirname "$1")" ; pwd -P )/$1"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
TARGET_ARCH=x86_64
export IPHONEOS_DEPLOYMENT_TARGET=12.2
rm -r /tmp/bitcode2intel
mkdir -p /tmp/bitcode2intel
pushd /tmp/bitcode2intel
View D22 DeviceTree.txt
/
target-type: 0x44
mlb-serial-number: syscfg/MLB#/0x20,zeroes/0x20
compatible: D22AP
secure-root-prefix:
AAPL,phandle: 0x01
platform-name: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
device_type: bootrom
region-info: syscfg/Regn/0x20,zeroes/0x20
regulatory-model-number: syscfg/RMd#/0x20
@steventroughtonsmith
steventroughtonsmith / dp1_target_image_creator.sh
Last active May 20, 2018
Mac OS X Server 1.x (Rhapsody)/Mac OS X Developer Preview 1 target partition creator for qemu-ppc
View dp1_target_image_creator.sh
#!/bin/sh
TARGET_IMAGE=1G_BLANK_MACOSX_DP1_DISK_IMAGE.img
#1G
DISKSIZE_IN_BLOCKS=2097152
#2G
#DISKSIZE_IN_BLOCKS=4194304
View gist:62f0b14d5ef532a4be2e2529187c100d
call ((NSWindow *)[(NSArray *)[[NSApplication sharedApplication] windows] lastObject]).collectionBehavior = 1<<7|1<<8|1<<11
@steventroughtonsmith
steventroughtonsmith / DrawingKit.swift
Created Sep 16, 2016
DrawingKit playground for iOS 10
View DrawingKit.swift
import PlaygroundSupport
import Foundation
import UIKit
Bundle(path: "/System/Library/PrivateFrameworks/DrawingKit.framework")?.load()
let DKInkView = NSClassFromString("DKInkView") as! UIView.Type
extension UIView {
func newGPUAvailable() -> Bool {
@steventroughtonsmith
steventroughtonsmith / main.m
Created Mar 24, 2016
Load Mach-O executable at runtime and execute its entry point
View main.m
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s\n", path);
handle = dlopen (path, RTLD_LAZY);
View gist:52f0c6783446b6fc536e
AddressBookUI.framework
(
"com.apple.people-picker"
)
AudioToolbox.framework
(
"com.apple.AudioUnit",
"com.apple.AudioUnit-UI"
@steventroughtonsmith
steventroughtonsmith / Show Tab Overview.py
Last active Jun 3, 2019
'Show Tab Overview' script for Pythonista - adds button to toolbar to show tab overview
View Show Tab Overview.py
# coding: utf-8
from objc_util import *
UIApplication = ObjCClass('UIApplication')
UIBarButtonItem = ObjCClass('UIBarButtonItem')
@on_main_thread
def main():
rootVC = UIApplication.sharedApplication().keyWindow().rootViewController()
@steventroughtonsmith
steventroughtonsmith / FileBrowser.py
Created Jan 14, 2016
File Browser for Pythonista
View FileBrowser.py
# coding: utf-8
from UIKit import *
from Foundation import *
from ctypes import *
libobjc = CDLL('/usr/lib/libobjc.dylib')
QLPreviewController = ObjCClass('QLPreviewController')
You can’t perform that action at this time.