This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MyClass is generic, and has a generic delegate. | |
// AClass creates two instances of MyClass and implements MyClassDelegate | |
// | |
// In the implementation of MyClassDelegate, how can I distinguish which object's delegate is calling | |
// func myClass<T>(_ myClass: MyClass<T>, valueDidChange value: T) | |
// | |
// See comments at end of file | |
protocol MyClassDelegate: class { | |
func myClass<T>(_ myClass: MyClass<T>, valueDidChange value: T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// A demo to show different blending modes using CGBlendMod | |
// | |
import UIKit | |
extension CGBlendMode { | |
static func count() -> Int { | |
return 16 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Available as a gist: https://gist.github.com/zakkhoyt/426cc6a5c2855d1b2feb4169df83bc9b | |
BINARY_TOOL="jq" | |
ANSI_BINARY_TOOL="\033[1m${BINARY_TOOL}\033[0m" | |
offer_brew_install() { | |
input="" | |
repeat=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Despite macOS'd grayed out icons, you can still launch Xcode 15 | |
/Applications/Xcode-15.4.0.app/Contents/MacOS/Xcode &> /dev/null & |