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
@mmackh
mmackh / IPDFContextMenu.h
Last active Oct 13, 2019
NSMenu in Catalyst
View IPDFContextMenu.h
//
// IPDFContextMenu.h
// InstaPDF
//
// Created by Maximilian Mackh on 02/02/15.
// Copyright (c) 2015 mackh ag. All rights reserved.
//
#import <Foundation/Foundation.h>
@omz
omz / Add Web Tab.py
Last active Jun 7, 2017 — forked from steventroughtonsmith/Add Web Tab.py
Insert a custom browser tab into Pythonista
View Add Web Tab.py
# coding: utf-8
from objc_util import *
import console
import urllib
import dialogs
WKWebView = ObjCClass('WKWebView')
UIViewController = ObjCClass('UIViewController')
UIBarButtonItem = ObjCClass('UIBarButtonItem')
NSURLRequest = ObjCClass('NSURLRequest')
@alfwatt
alfwatt / create-elcap-install-iso.sh
Last active Jan 12, 2017
Create OS X Install ISO Scripts
View create-elcap-install-iso.sh
#!/bin/bash
OSX_NAME=ElCapitan
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
hdiutil create -o $OSX_NAME.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach $OSX_NAME.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/iso
asr restore -source /Volumes/esd/BaseSystem.dmg -target /Volumes/iso -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/esd/Packages /Volumes/OS\ X\ Base\ System/System/Installation
View homebridge
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@lg
lg / build_tvvlckit.sh
Last active Mar 22, 2018
Building MobileVLCKit for AppleTV: TVVLCKit
View build_tvvlckit.sh
# note these instructions are as of Dec 28, 2015
# the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet.
# so, you'll need to mess with things a bit
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t
@conradev
conradev / simulatorconsole
Last active Dec 16, 2015
simulatorconsole
View simulatorconsole
#!/bin/bash
tail -f $(ls -t "$HOME/Library/Logs/CoreSimulator/"*/system.log | head -1)
@Kehet
Kehet / export.lua
Created Aug 17, 2014
World of Warcrafts Dungeon Journal Exporter to XML (may cause hangout, use with caution)
View export.lua
local flags = {"tank", "dps", "healer", "heroic", "deadly", "important", "interruptible", "magic", "curse", "poison", "disease", "enrage", "enrage"}
local EJ_DIFF_N = 1
local EJ_DIFF_HC = 2
local EJ_DIFF_10 = 3
local EJ_DIFF_25 = 4
local EJ_DIFF_10HC = 5
local EJ_DIFF_25HC = 6
local EJ_DIFF_LFR = 7
local EJ_DIFF_CHA = 8
@omz
omz / Dropbox File Picker.py
Last active Sep 3, 2019
Dropbox File Picker.py
View Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@cieslak
cieslak / ‽.swift
Created Jun 13, 2014
Interrobang operator in Swift
View ‽.swift
import Foundation
operator postfix {}
@postfix func <T>(value: T?) -> T? {
return (arc4random_uniform(2) == 1) ? value : nil
}
@steventroughtonsmith
steventroughtonsmith / HWKViewController.m
Last active May 10, 2019
Example of dynamic iOS UI that changes based on the connection/disconnection of a hardware keyboard, based on suggestions from @JohnRHeaton. Requires linking to private GraphicsServices framework. rdar://problem/15447952
View HWKViewController.m
//
// HWKViewController.m
// HardwareKeyboardUI
//
// Created by Steven Troughton-Smith on 13/11/2013.
// Copyright (c) 2013 High Caffeine Content. All rights reserved.
//
#import "HWKViewController.h"
You can’t perform that action at this time.