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
import Foundation | |
import APIKit | |
import RxSwift | |
extension Session { | |
func rx_sendRequest<T: Request>(request: T) -> Observable<T.Response> { | |
return Observable.create { observer in | |
let task = self.send(request) { result in | |
switch result { | |
case .success(let res): |
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
//Protocal that copyable class should conform | |
protocol Copying { | |
init(original: Self) | |
} | |
//Concrete class extension | |
extension Copying { | |
func copy() -> Self { | |
return Self.init(original: self) | |
} |
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
#!/bin/bash | |
#Script to get all repositories under a user from bitbucket | |
#Usage: getAllRepos.sh [username] [password] | |
curl --user ${1}:${2} https://api.bitbucket.org/1.0/users/${1} > repoinfo | |
for repo_name in `grep \"name\" repoinfo | cut -f4 -d\"` | |
do | |
git clone https://${1}@bitbucket.org/${1}/$repo_name | |
done |