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
// Hello | |
// test | |
background: #f06;background: linear-gradient(45deg, #f06, yellow);min-height: 100%; |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f07; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
Source https://stackoverflow.com/questions/11197509/how-to-get-device-make-and-model-on-ios | |
@"iPhone1,1" on iPhone | |
@"iPhone1,2" on iPhone 3G | |
@"iPhone2,1" on iPhone 3GS | |
@"iPhone3,1" on iPhone 4 (GSM) | |
@"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint) | |
@"iPhone4,1" on iPhone 4S | |
@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada) | |
@"iPhone5,2" on iPhone 5 (model A1429, everything else) |
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 | |
/// List of states that can be used to update an asynchronous operation state. | |
public enum AsyncOperationState { | |
case ready | |
case executing | |
case finished | |
fileprivate var keyPath: String { | |
switch self { |
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
// http://astexplorer.net/#/BICnPGGYdU/4 | |
export default function ({types: t}) { | |
return { | |
visitor: { | |
FunctionDeclaration(path) { | |
if (path.node.generator) { | |
path.node.async = true | |
path.node.generator = false | |
} |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
/// Find first differing character between two strings | |
/// | |
/// :param: s1 First String | |
/// :param: s2 Second String | |
/// | |
/// :returns: .DifferenceAtIndex(i) or .NoDifference |
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 PlaygroundSupport | |
import RxSwift | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
extension ObservableType where E: Sequence { | |
typealias T = E.Iterator.Element | |
/// Create an observable which is an Array of the projected values |
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 PlaygroundSupport | |
import RxSwift | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
/// ConcatMap Operator | |
/// Runs all observable sequences in parallel and concat their elements. | |
extension ObservableType { | |
func concatMap<T>(project: @escaping (E) -> Observable<T>) -> Observable<T> { | |
return self.map { (element) -> Observable<T> 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 Foundation | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
/// define an operation success or error result | |
enum Result<T> { | |
case error(Error) | |
case success(T) | |
} |
NewerOlder