Skip to content

Instantly share code, notes, and snippets.

@dvessel
dvessel / macOS_SytemPrefs.md
Created April 15, 2023 15:29 — 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
url scheme:
x-apple.systempreferences:com.apple.KEY[.KEY]?SUB-PANE
examples:
x-apple.systempreferences:com.apple.systempreferences.AppleIDSettings?iCloud
x-apple.systempreferences:com.apple.preference.keyboard?Shortcuts
urls:
com.apple.systempreferences.ApplelDSettings
@derekcoder
derekcoder / gist:a549631b25a44467d5590c2dffd95591
Created January 5, 2021 09:52
genstrings for SwiftUI project
find . -name \*.swift | xargs genstrings -SwiftUI
@DoctorDerek
DoctorDerek / recommended-settings.json
Last active March 31, 2024 07:31
Recommended settings.json file for new web developers setting up VS Code according to https://medium.com/p/65aaa5788c0d/ by Dr. Derek Austin 🥳
@aerobounce
aerobounce / macOS System Preference Pane Links.md
Last active April 19, 2024 14:26
macOS System Preference Pane Links
@IsaacXen
IsaacXen / README.md
Last active May 2, 2024 09:57
(Almost) Every WWDC videos download links for aria2c.
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active May 4, 2024 07:49
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
@T1T4N
T1T4N / URLSession+DataTaskProgressPublisher.swift
Last active May 2, 2023 07:39
Emulating a DataTaskPublisher with Progress
#if canImport(Combine)
import Foundation
import Combine
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension URLSession {
public typealias DataTaskProgressPublisher =
(progress: Progress, publisher: AnyPublisher<DataTaskPublisher.Output, Error>)
@coolaj86
coolaj86 / MacOS-Icons.md
Last active May 1, 2024 22:18
MacOS Default Icons Locations

How to Find ANY Icon

  1. Open the application such that you see the icon on your screen.
  2. Open Activity Monitor
  3. Double click the name of the application (i.e. Finder or System Preferences)
  4. Select "Open Files and Ports"
  5. Copy the output to a file and then grep for .icns

Similarly you could run this command, but it may take several minutes to complete:

@BadPirate
BadPirate / README.md
Created January 28, 2020 19:22
A utility class for capturing iOS App Will Suspend, and App Did Un-suspend events

Summary

iOS doesn't report when an app will be suspended (placed from background into a non-processing state) nor does it seem to fire a notification once the app has resumed. There is some confusion about this as there is a notification when the app becomes "active" or will resign the "active" state, however this is not always the right value needed. iOS Apps have a number of states:

  1. Active: App is in the foreground (frontmost) and there are no notifications or menu's pulled over it. Pulling a menu down or getting an external notification or text message will cause the app to "resign" active, and resume active once the alert has been dealt with.
  2. Background: App is not in the foreground but still processing. This happens briefly before suspend if there are no background tasks running, or can be a permanent state if there is a long running background mode (audio, location, etc) running.