Skip to content

Instantly share code, notes, and snippets.

@dinneo
dinneo / camel_case.swift
Created July 30, 2023 13:09 — forked from stevenschobert/camel_case.swift
Camel-case a string in Swift
func camelCaseString(source: String) -> String {
if contains(source, " ") {
let first = source.substringToIndex(advance(source.startIndex, 1))
let cammel = NSString(format: "%@", (source as NSString).capitalizedString.stringByReplacingOccurrencesOfString(" ", withString: "", options: nil, range: nil)) as String
let rest = dropFirst(cammel)
return "\(first)\(rest)"
} else {
let first = (source as NSString).lowercaseString.substringToIndex(advance(source.startIndex, 1))
let rest = dropFirst(source)
return "\(first)\(rest)"
@dinneo
dinneo / Camelizer.swift
Created July 30, 2023 12:58 — forked from reitzig/Camelizer.swift
Convert Swift strings to camel case
fileprivate let badChars = CharacterSet.alphanumerics.inverted
extension String {
var uppercasingFirst: String {
return prefix(1).uppercased() + dropFirst()
}
var lowercasingFirst: String {
return prefix(1).lowercased() + dropFirst()
}
@dinneo
dinneo / String+CamelCase.swift
Created July 30, 2023 12:56 — forked from adamgraham/String+CamelCase.swift
An extension of the Swift String type to provide camel case formatting.
/// An extension to format strings in *camel case*.
extension String {
/// A collection of all the words in the string by separating out any punctuation and spaces.
var words: [String] {
return components(separatedBy: CharacterSet.alphanumerics.inverted).filter { !$0.isEmpty }
}
/// Returns a copy of the string with the first word beginning lowercased, and the first
/// letter of each word thereafter is capitalized, with no intervening spaces or punctuation,
@dinneo
dinneo / README.md
Created July 11, 2023 08:46 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
Advanced Animations with UIKit
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_hd_advanced_animations_with_uikit.mp4?dl=1
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_advanced_animations_with_uikit.pdf
Advanced Touch Bar
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_hd_advanced_touch_bar.mp4?dl=1
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_advanced_touch_bar.pdf
Advances in TVMLKit
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/202ximbb9e2dq222/202/202_hd_advances_in_tvmlkit.mp4?dl=1
@dinneo
dinneo / macOS_SytemPrefs.md
Created July 4, 2023 08:35 — forked from dvessel/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
@dinneo
dinneo / macOS_SytemPrefs.md
Created July 4, 2023 08:12 — 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
find . -name \*.swift | xargs genstrings -SwiftUI