Skip to content

Instantly share code, notes, and snippets.


Steven Troughton-Smith steventroughtonsmith

View GitHub Profile
View gist:62f0b14d5ef532a4be2e2529187c100d
call ((NSWindow *)[(NSArray *)[[NSApplication sharedApplication] windows] lastObject]).collectionBehavior = 1<<7|1<<8|1<<11
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 / 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
steventroughtonsmith / Show Tab
Last active Nov 4, 2020
'Show Tab Overview' script for Pythonista - adds button to toolbar to show tab overview
View Show Tab
# coding: utf-8
from objc_util import *
UIApplication = ObjCClass('UIApplication')
UIBarButtonItem = ObjCClass('UIBarButtonItem')
def main():
rootVC = UIApplication.sharedApplication().keyWindow().rootViewController()
steventroughtonsmith /
Created Jan 14, 2016
File Browser for Pythonista
# coding: utf-8
from UIKit import *
from Foundation import *
from ctypes import *
libobjc = CDLL('/usr/lib/libobjc.dylib')
QLPreviewController = ObjCClass('QLPreviewController')
steventroughtonsmith / Add Web
Created Jan 13, 2016
Insert a custom browser tab into Pythonista
View Add Web
# coding: utf-8
from Foundation import *
from QuartzCore import *
from UIKit import *
import console
WKWebView = ObjCClass('WKWebView')
steventroughtonsmith /
Last active Nov 1, 2020
UIKit+UIFoundation & Foundation for Pythonista - autoconverted from SDK tbd (includes non-public SPI)
# coding: utf-8
from objc_util import *
NSAKDeserializer = ObjCClass('NSAKDeserializer')
NSAKDeserializerStream = ObjCClass('NSAKDeserializerStream')
NSAKSerializer = ObjCClass('NSAKSerializer')
NSAKSerializerStream = ObjCClass('NSAKSerializerStream')
NSAbstractLayoutGuide = ObjCClass('NSAbstractLayoutGuide')
NSAddressCheckingResult = ObjCClass('NSAddressCheckingResult')
NSAffineTransform = ObjCClass('NSAffineTransform')
steventroughtonsmith / charts.html
Last active Nov 1, 2015
AppleTV App Store Charts US Nov 1 2015
View charts.html
<head><style>table {margin: -10px} img {width: 160px; height:96px; margin: 5px; border-radius: 15px;}</style></head><body bgColor=lightgrey></body><h3> Paid Apps</h3><p><table width="600" bgcolor="lightgrey"><tbody><tr><td width="50">1)</td><td width="160"><p><img src=""></p></td><td>$9.99 <a href="">Beat Sports</a><p>★★★★✩</p></td></tr></tbody></table></p><p><table width="600" bgcolor="#bdbdbd"><tbody><tr><td width="50">2)</td><td width="160"><p><img src=""></p></td><td>$2.99 <a href="">SimpleX - for Plex</a><p>★★★✩✩</p></td></tr></tbody></table></p><p><table width="600" bgcolor="lightgrey"><tbody><tr><td width="50">3)</td><td width="160"><p><img src="http://
steventroughtonsmith / gist:6788b6c340a0aa52345a
Created Oct 27, 2015
Run OS X Screen Saver as Wallpaper
View gist:6788b6c340a0aa52345a
/System/Library/Frameworks/ScreenSaver.framework/Resources/ -background
You can’t perform that action at this time.