Skip to content

Instantly share code, notes, and snippets.

View stormychel's full-sized avatar
🍏

Michel Storms stormychel

🍏
View GitHub Profile
@stormychel
stormychel / macOS_SytemPrefs.md
Created January 8, 2026 09:59 — forked from rmcdongit/macOS_SytemPrefs.md
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@stormychel
stormychel / URLResponse+HTTP.swift
Created May 9, 2024 04:33 — forked from messeb/URLResponse+HTTP.swift
URLResponse as HTTPURLResponse and check if call has status code 2xx
extension URLResponse {
/// Returns casted `HTTPURLResponse`
var http: HTTPURLResponse? {
return self as? HTTPURLResponse
}
}
extension HTTPURLResponse {
/// Returns `true` if `statusCode` is in range 200...299.
/// Otherwise `false`.
@stormychel
stormychel / Iso369_1.swift
Created June 22, 2023 15:18 — forked from proxpero/Iso369_1.swift
A Swift 4.0 enum representing ISO 639-1 codes (used to classify languages)
// taken 2018-03-19 from wikipedia. https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
public enum Iso639_1: String {
case ab = "AB"
case aa = "AA"
case af = "AF"
case ak = "AK"
case sq = "SQ"
case am = "AM"
case ar = "AR"
@stormychel
stormychel / PreviousViewController.swift
Created November 27, 2022 23:29 — forked from susieyy/PreviousViewController.swift
Access previous view controller in navigation stack
extension UIViewController {
var previousViewController: UIViewController? {
guard let navigationController = navigationController else { return nil }
let count = navigationController.viewControllers.count
return count < 2 ? nil : navigationController.viewControllers[count - 2]
}
}
@stormychel
stormychel / create-folder.py
Created May 7, 2021 19:55 — forked from keithweaver/create-folder.py
Create a folder with Python
import os
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)