- これらは、プライベートで使っているツールです
- 全て使えば良いのではなく、自分のユースケースに合えば選択してみてくださいくらいのモチベーション
to4iki/dotfilesで諸々管理しているので、良かったら参考にしてください
| git | |
| ghq | |
| fzf | |
| git-now | |
| tig | |
| tmux | |
| gh | |
| jq | |
| fish |
| // MARK: Date + SwiftCheck | |
| extension Date: RandomType { | |
| public static func randomInRange<G : RandomGeneneratorType>(_ range : (Date, Date), gen : G) -> (Date, G) { | |
| let (min, max) = range | |
| let (t, gen2) = Double.randomInRange((min.timeIntervalSince1970, max.timeIntervalSince1970), gen: gen) | |
| return (Date(timeIntervalSince1970: t), gen2) | |
| } | |
| } |
| import Foundation | |
| // https://qiita.com/risuke/items/cdd6a75f236faae3ce6b | |
| // https://gist.github.com/budidino/8585eecd55fd4284afaaef762450f98e | |
| extension String { | |
| enum TruncationPosition { | |
| case head | |
| case middle | |
| case tail | |
| } |
| /// See also: | |
| /// - https://github.com/RxSwiftCommunity/Action | |
| /// - https://github.com/ukitaka/RealmIO | |
| /// - https://medium.com/@JorgeCastilloPr/kotlin-dependency-injection-with-the-reader-monad-7d52f94a482e | |
| public class Reader<Input, Element> { | |
| public typealias WorkFactory = (Input) -> Element | |
| private let workFactory: WorkFactory | |
| public init(_ workFactory: @escaping WorkFactory) { |
| import Foundation | |
| // See also: https://qiita.com/pab_tech/items/1c0bdbc8a61949891f1f | |
| protocol Clock { | |
| var now: Date { get } | |
| } | |
| struct SystemClock: Clock { | |
| let now: Date = Date() |
| import Foundation | |
| typealias Parameters = [AnyHashable: Any] | |
| protocol Converter { | |
| func convert(_ input: Any) -> Any | |
| } | |
| struct BoolConverter: Converter { | |
| func convert(_ input: Any) -> Any { |
| /// See also | |
| /// - http://www.ne.jp/asahi/hishidama/home/tech/scala/sample/using.html | |
| /// - https://qiita.com/piyo7/items/c9be1f39bcfea43a778a | |
| protocol Closer { | |
| func close() | |
| } | |
| struct Loan { | |
| @discardableResult |
| import APIKit | |
| import RxSwift | |
| extension Session: ReactiveCompatible {} | |
| extension Reactive where Base: Session { | |
| public static func send<T: Request>(_ request: T) -> Single<T.Response> { | |
| return Single<T.Response>.create { observer in | |
| let task = Session.send(request, callbackQueue: .main) { result in | |
| switch result { |
to4iki/dotfilesで諸々管理しているので、良かったら参考にしてください
| import Foundation | |
| // MARK: - EmailValidationError | |
| enum EmailValidationError: Error { | |
| case empty | |
| case invalidFormat | |
| } | |
| // MARK: - PasswordValidationError |