Skip to content

Instantly share code, notes, and snippets.

View interstateone's full-sized avatar
👋

Brandon Evans interstateone

👋
View GitHub Profile
@interstateone
interstateone / macOS-big-sur-iso.sh
Last active June 23, 2020 03:41 — forked from jamieparfet/macOS-mojave-iso.sh
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~10GB Big Sur installer is in the /Applications folder.
hdiutil create -o /tmp/bigsur.cdr -size 10g -layout SPUD -fs HFS+J
hdiutil attach /tmp/bigsur.cdr.dmg -noverify -mountpoint /Volumes/InstallBigSur
# You need to manually erase the new volume in Disk Utility otherwise the next command will fail
# The use of /Volumes/untitled is deliberate, because that's what its name will be after the preceding commands
# Not sure why that is
sudo /Applications/Install\ macOS\ Beta.app/Contents/Resources/createinstallmedia --volume /Volumes/untitled
@interstateone
interstateone / uiappearance-selector.md
Last active April 7, 2020 14:39 — forked from mattt/uiappearance-selector.md
A list of methods and properties conforming to `UIAppearance` as of iOS 13.4

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
var body: some View {
Text("Hello World! 👋🌎")
}
}
PlaygroundPage.current.liveView = UIHostingController(rootView: ContentView())
@interstateone
interstateone / gist:dbe67fa6f6a68b107e3b4078cb6cc9bb
Created June 7, 2019 20:26 — forked from henning-jh/*.swift
Sign In with Apple: create button
import AuthenticationServices
func createButton() {
let authorizationButton = ASAuthorizationAppleIDButton()
authorizationButton.addTarget(self, action:
#selector(handleAuthorizationAppleIDButtonPress),
for: .touchUpInside)
myView.addSubview(authorizationButton)
}
@interstateone
interstateone / 2-non-interruptive-notifications-on-ios.swift
Created April 11, 2019 02:54
Non-interruptive notifications on iOS
UNUserNotificationCenter.current().getNotificationSettings { settings in
if settings.authorizationStatus == .authorized,
settings.soundSetting == .disabled,
settings.alertSetting == .disabled,
settings.badgeSetting == .disabled {
// Deliver Quietly
}
}
@interstateone
interstateone / 1-non-interruptive-notifications-on-ios.swift
Last active April 11, 2019 02:54
Non-interruptive notifications on iOS
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .provisional]) { granted, error in
// Handle response...
}
# Fastfile
app_info = {
app_one: {
project: "AppOne.xcodeproj",
scheme: "AppOne",
config: "Release",
profile: "AppOne Distribution"
}
# etc.!
# Gemfile
source 'https://rubygems.org'
gem 'fastlane'
group :ci do
gem 'slather'
gem 'danger'
gem 'danger-swiftlint'
gem 'git_diff'
#!/bin/bash
#
# ~/bin/backup-photos
file="Photos Library.photoslibrary"
path="/Users/brandon/Pictures/$file"
read -r -p "Do you want to backup $file to the Photo Storage volume? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ && -d "$path" ]]; then
@interstateone
interstateone / README.md
Last active September 16, 2015 02:07
A hacked-together xcodebuild vim plugin