Skip to content

Instantly share code, notes, and snippets.

View steventroughtonsmith's full-sized avatar

Steven Troughton-Smith steventroughtonsmith

View GitHub Profile
//
// VolumePopupView.swift
//
// Created by Alex Rosenberg on 1/24/24.
//
import SwiftUI
import AVFoundation
import MediaPlayer
@steventroughtonsmith
steventroughtonsmith / V3DViewContainer.swift
Created February 2, 2024 17:14
UIKit proxy for visionOS 3D transforms and effects
//
// V3DViewContainer.swift
// Vision3DUIKit
//
// Created by Steven Troughton-Smith on 02/02/2024.
//
import UIKit
import SwiftUI
@matteyeux
matteyeux / decrypted.json
Created November 20, 2023 13:15
Apple Vision Pro firmware keys for VisionOS 1.0 beta 1-5
[
{
"url": "https://updates.cdn-apple.com/2023SummerSeed/patches/042-21091/60572AF0-9BC3-465F-89ED-77117194CB26/com_apple_MobileAsset_SoftwareUpdate/3df121022bd578846478faa25a4dcf3055396954.zip",
"build": "21N5207g",
"filename": "iBEC.n301.RELEASE.im4p",
"kbag": "AB7893B981E44BFF298328C89C826F8BA6EF1A7ADC80DB156C9D55D9F4E27E8AD2CC21AFA42A41E1392B57E9FE90D992",
"key": "34b218667cd03eb93e073b9b3bca4a865b20f130550a800b2aa2c1c2348041865cee47db7e3bcda739d05adde9f9f716"
},
{
"url": "https://updates.cdn-apple.com/2023SummerSeed/patches/042-21091/60572AF0-9BC3-465F-89ED-77117194CB26/com_apple_MobileAsset_SoftwareUpdate/3df121022bd578846478faa25a4dcf3055396954.zip",
@steventroughtonsmith
steventroughtonsmith / PSTLMacOS11AwarePopUpButton.swift
Created October 23, 2022 00:09
macOS 11-compatible Mac Catalyst PopUp Button (Private API)
class PSTLMacOS11AwarePopUpButton: UIButton {
var selectedPopUpIndex = 0 {
didSet {
sendActions(for: .valueChanged)
}
}
override var menu: UIMenu? {
set {
/* Button title must match first menu item */
@rileytestut
rileytestut / ExportIPA.swift
Last active March 4, 2024 09:36
Export Swift Playgrounds .ipa
import Foundation
// Export running app as .ipa, then return path to exported file.
// Returns String because app crashes when returning URL from async function for some reason...
func exportIPA() async throws -> String
{
// Path to app bundle
let bundleURL = Bundle.main.bundleURL
// Create Payload/ directory
@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active April 15, 2024 13:47 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Relax
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_relax/bbc_radio_one_relax.isml/bbc_radio_one_relax-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@mmackh
mmackh / IPDFContextMenu.h
Last active May 31, 2020 23:55
NSMenu in Catalyst
//
// IPDFContextMenu.h
// InstaPDF
//
// Created by Maximilian Mackh on 02/02/15.
// Copyright (c) 2015 mackh ag. All rights reserved.
//
#import <Foundation/Foundation.h>
@adamgraham
adamgraham / UIColor+CMYK.swift
Last active November 24, 2022 04:12
An extension of the iOS class UIColor to provide conversion to and from CMYK (cyan, magenta, yellow, black) colors.
/// An extension to provide conversion to and from CMYK (cyan, magenta, yellow, black) colors.
extension UIColor {
/// The CMYK (cyan, magenta, yellow, black) components of a color, in the range [0, 100%].
struct CMYK: Hashable {
/// The cyan component of the color, in the range [0, 100%].
var cyan: CGFloat
/// The magenta component of the color, in the range [0, 100%].
var magenta: CGFloat
@omz
omz / Add Web Tab.py
Last active December 3, 2023 23:33 — forked from steventroughtonsmith/Add Web Tab.py
Insert a custom browser tab into Pythonista
# 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 January 12, 2017 20:51
Create OS X Install ISO Scripts
#!/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