brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
| <script src="https://unpkg.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script> | |
| <script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
| <script src="https://fb.me/react-dom-15.1.0.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.compat.js"></script> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> |
| // | |
| // NSData.swift | |
| // Pods | |
| // | |
| // Created by Tanner Nelson on 9/15/15. | |
| // | |
| // | |
| import Foundation |
| do { | |
| let count = 1 // number of UInt32s | |
| let stride = MemoryLayout<UInt32>.stride | |
| let alignment = MemoryLayout<UInt32>.alignment | |
| let byteCount = count * stride | |
| var bytes : [UInt8] = [0x0D, 0x0C, 0x0B, 0x0A] // little-endian LSB -> MSB | |
| var data : Data = Data.init(bytes: bytes) | |
| print("---------------- 1 ------------------") |
| let bytes : [UInt8] = [0xF1, 0xE1, 0xD1, 0xC1, 0xB1, 0xA1, 0x91] // little-endian LSB -> MSB | |
| let data : Data = Data.init(bytes: bytes) | |
| let result = convert(from: data, to:UInt32.self, at:3) | |
| print("\(String(format: "0x%8X",result!))") | |
| print(result!) | |
| func convert<T>(from data: Data, to: T.Type, at offset:Int) -> T? { |
| // | |
| // NSData+Convert.swift | |
| // rxbt-test | |
| // | |
| // Created by Julian Bleecker on 2/6/17. | |
| // Copyright © 2017 OMATA. All rights reserved. | |
| // | |
| import Foundation |
| @IBOutlet weak var usernameOutlet: UITextField! | |
| @IBOutlet weak var switchOutlet: UISwitch! | |
| let t = Observable<Int>.interval(1, scheduler: MainScheduler.instance).take(4) | |
| let trueOrFalse = t.mapWithIndex{ $0 }.map{ $1 % 2 == 0 } | |
| _ = trueOrFalse.bindTo(switchOutlet.rx.isOn) | |
| _ = trueOrFalse.bindTo(usernameOutlet.rx.isEnabled) | |
| _ = trueOrFalse.subscribe(onNext: { |
| let a : [Int] = [1,2,3,4] | |
| let n = Observable<Int>.from(a).mapWithIndex{ $0 } | |
| .filter {$1 % n == 0 } | |
| .map{ $0.0 } | |
| _ = n.subscribe(onNext: { | |
| print("every nth \($0)") | |
| }) |
| let a : [Int] = [1,2,3,4,5,6,7,8,9,10] | |
| Observable<Int>.interval(1, scheduler: MainScheduler.instance) | |
| Observable<Int>.interval(2, scheduler: MainScheduler.instance).mapWithIndex{ $0 }.filter { ($1 % 2 == 0 && $1 < a.endIndex)}.map{ a[$0.0]}.subscribe(onNext: { | |
| print("every 2nd \($0)") | |
| }) |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
| import PlaygroundSupport | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| import UIKit | |
| import RxSwift | |
| import RxCocoa | |
| import RxOptional | |
| import Foundation | |
| let letters = ["A","B","C","D","E","F"] |