This file contains 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
import Foundation | |
import Combine | |
enum APIError: Error, LocalizedError { | |
case unknown, apiError(reason: String) | |
var errorDescription: String? { | |
switch self { | |
case .unknown: | |
return "Unknown error" |
This file contains 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
### Global configuration | |
# Enable rules which are not in the default set | |
opt_in_rules: | |
# - anyobject_protocol # Prefer using `AnyObject` over `class` for class-only protocols. | |
# - array_init # Prefer using `Array(seq)` over `seq.map { $0 }` to convert a sequence into an Array. | |
# - attributes # Attributes should be on their own lines in functions and types, but on the same line as variables and imports. | |
- block_based_kvo # Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. | |
- class_delegate_protocol # Delegate protocols should be class-only so they can be weakly referenced. | |
- closing_brace # Closing brace with closing parenthesis should not have any whitespaces in the middle. |
This file contains 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
import UIKit | |
import PlaygroundSupport | |
class MyViewController : UIViewController { | |
// 1. | |
lazy var stackView: UIStackView = { | |
let stackView = UIStackView() | |
stackView.axis = .horizontal | |
stackView.spacing = 20 |
This file contains 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
function parse_git_branch() { | |
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p' | |
} | |
COLOR_DEF=$'\e[0m' | |
COLOR_USR=$'\e[38;5;243m' | |
COLOR_DIR=$'\e[38;5;197m' | |
COLOR_GIT=$'\e[38;5;39m' | |
setopt PROMPT_SUBST |
OlderNewer