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
enum Font { | |
static func customFont(of size: CGFloat) -> UIFont { | |
guard let language = NSLocale.preferredLanguages.first, | |
language.contains("ja") else { | |
return UIFont(name: "Hiragino Sans", size: size) ?? UIFont.systemFont(ofSize: size) | |
} | |
return UIFont(name: "Hiragino Sans", size: size) ?? UIFont.systemFont(ofSize: size) | |
} |
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 OAuthSwift | |
import RxSwift | |
extension OAuth2Swift { | |
func authorize(with callbackURL: URL, | |
scope: String, | |
state: String, | |
parameters: Parameters = [:], | |
headers: OAuthSwift.Headers? = nil) -> Observable<TokenSuccess> { | |
return Single<TokenSuccess>.create { [weak self] observer -> Disposable in |
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 APIKit | |
import RxSwift | |
extension Session { | |
func send<T: Request>(_ request: T) -> Observable<T.Response> { | |
return Single<T.Response>.create { [weak self] observer -> Disposable in | |
guard let me = self else { return Disposables.create() } | |
me.send(request) { result in | |
switch result { | |
case .success(let value): |
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
502 Bad Gateway Error Nginx connect() to unix:/tmp/unicorn.sock failed |
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
$ cd ~/.ssh/ | |
$ ssh-keygen -t rsa -C "メールアドレス" | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/Users/ユーザー名/.ssh/id_rsa): github_id_rsa | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in github_id_rsa. | |
Your public key has been saved in github_id_rsa.pub. | |
~以下略~ |