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
#!/bin/bash | |
function print_usage() { | |
echo "Usage: $0 [Options]" | |
echo "Options:" | |
echo " -h, --help Display usage" | |
echo " -p, --project-directory Directory containing Carthage project" | |
echo " -f, --force Omit confirmation" | |
exit 1 | |
} |
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
#!/bin/sh | |
# pup: [https://github.com/EricChiang/pup] | |
# URL を http://www.lgtm.in/g/RyogaK のようにすれば自分のマイリストから取り出せるのでオススメ | |
echo "\" | pbcopy |
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
// | |
// CircularPageView.swift | |
// Created by Ryoga Kitagawa on 2017/07/22. | |
// | |
import Foundation | |
private let preLoadedCellNum: Int = 1 | |
private let maxVisibleCellNum: Int = preLoadedCellNum * 2 + 1 |
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 RxSwift | |
protocol ModelInputs { | |
func doSomething(strs: [String]) | |
} | |
protocol ModelOutputs { | |
var outputInts: Observable<[Int]> { get } | |
} |
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
// | |
// Repeat.swift | |
// | |
// Created by Ryoga Kitagawa on 4/24/17. | |
// | |
import RxSwift | |
extension ObservableType { | |
func `repeat`() -> Observable<E> { |
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
#!/bin/bash | |
# Run SwiftLint | |
START_DATE=$(date +"%s") | |
SWIFT_LINT=/usr/local/bin/swiftlint | |
# Run SwiftLint for given filename | |
run_swiftlint() { | |
local filename="${1}" |
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 RxSwift | |
import Result | |
public struct ResultErrorEnvelope: ErrorType { | |
let originError: ErrorType | |
} | |
public extension ObservableType { | |
public func catchAndConvertToResult() -> Observable<Result<E, ResultErrorEnvelope>> { | |
return map(Result.Success) |
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
// | |
// UIAlertController+Rx.swift | |
// | |
import Foundation | |
import RxSwift | |
protocol RxAlertActionType { | |
associatedtype Result |
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
// | |
// AlertHasHeaderController.swift | |
// | |
// Created by Ryoga Kitagawa on 8/24/16. | |
// Copyright © 2016 Ryoga Kitagawa. All rights reserved. | |
// | |
import UIKit | |
final class AlertHasHeaderController: UIAlertController { |
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
class Entity {} | |
struct Token { | |
let entity = Entity() | |
} | |
func asyncProcess() -> Token { | |
let token = Token() | |
weak var entity = token.entity | |
dispatch_async(dispatch_get_main_queue) { | |
// 重くてキャンセルできない処理 |
NewerOlder