- ะฃััะฐะฝะพะฒะบะฐ
- ะะฑะฝะพะฒะธัั Homebrew
$ brew update - ะฃััะฐะฝะพะฒะธัั PostgreSQL
$ brew install postgres
- ะะฑะฝะพะฒะธัั Homebrew
- ะะฐัััะพะนะบะฐ
- ะะฐะฟัััะธัั ัะตัะฒะตั ะฑะฐะทั ะดะฐะฝะฝัั
$ postgres -D /usr/local/var/postgres
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
| extension Optional where Wrapped == String { | |
| var isEmpty: Bool { return map { $0.isEmpty } ?? true } | |
| } | |
| extension Optional where Wrapped == Collection { | |
| var isEmpty: Bool { return map { $0.isEmpty } ?? true } | |
| } |
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
| osascript -e 'tell application "Messages" to send "Hello World" to buddy "+1234567890" of (1st service whose service type = iMessage)' |
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
| #!/usr/bin/env bash | |
| cd "$(dirname "$0")" | |
| source ml-env/bin/activate | |
| jupyter notebook |
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
| extension URLRequest { | |
| func property(forKey key: String) -> Any? { | |
| return URLProtocol.property(forKey: key, in: self) | |
| } | |
| mutating func setProperty(_ value: Any, forKey key: String) { | |
| mutate { URLProtocol.setProperty(value, forKey: key, in: $0) } | |
| } |
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
| class KeyPathAnimation<View, Value> { | |
| let basicAnimation: CABasicAnimation | |
| let keyPath: KeyPath<View, Value> | |
| init(keyPath: KeyPath<View, Value>) { | |
| self.keyPath = keyPath | |
| // https://github.com/apple/swift/blob/2844583d7f9d51ce5c4da7776e19f0aab6f2e3f6/stdlib/public/core/KeyPath.swift#L107 | |
| basicAnimation = CABasicAnimation(keyPath: keyPath._kvcKeyPathString) | |
| } |
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
| func measure(_ name: String, _ block: () -> Void) { | |
| let machToSeconds: Double = { | |
| var timebase: mach_timebase_info_data_t = mach_timebase_info_data_t() | |
| mach_timebase_info(&timebase) | |
| return Double(timebase.numer) / Double(timebase.denom) * 1e-9 | |
| }() | |
| let startTime = mach_absolute_time() | |
| block() | |
| let endTime = mach_absolute_time() |
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
| extension Locale { | |
| static func locale(forCurrencyCode currencyCode: String) -> Locale? { | |
| return availableIdentifiers.lazy | |
| .map { Locale(identifier: $0) } | |
| .first { $0.currencyCode == currencyCode } | |
| } | |
| static func currencySymbol(forCurrencyCode currencyCode: String) -> String? { | |
| return locale(forCurrencyCode: currencyCode).flatMap { $0.currencySymbol } | |
| } |
| Function name | Condition | In playgrounds and -Onone builds (the default for Xcode's Debug configuration) |
In -O builds (the default for Xcode's Release configuration) |
In -Ounchecked builds |
|---|---|---|---|---|
| assert | ๐ | ๐ | โช | โช |
| assertionFailure | โช | ๐ | โช | โช |
| precondition | ๐ | ๐ | ๐ | โช |
| preconditionFailure | โช | ๐ | ๐ | โช |
| fatalError | โช | ๐ | ๐ | ๐ |
| dispatchPrecondition | ๐ | ๐ | ๐ | โช |