(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
| <input id="file" type="file" accept="image/*" /> | |
| <br/> | |
| <h2>As read:</h2> | |
| <img id="placeholder1" width=300/><br/> | |
| <h2>Rotated by exif data:</h2> | |
| <img id="placeholder2" width=300/> | |
| <script> |
| // [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
| Array.prototype.flatMap = function(lambda) { | |
| return Array.prototype.concat.apply([], this.map(lambda)); | |
| }; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # /tmp/test = EBS-SSD | |
| # /mnt/test = instance-store | |
| root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
| 256+0 records in | |
| 256+0 records out | |
| 268435456 bytes (268 MB) copied, 3.26957 s, 82.1 MB/s | |
| root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
| 256+0 records in | |
| 256+0 records out |
| import Foundation | |
| /// Find first differing character between two strings | |
| /// | |
| /// :param: s1 First String | |
| /// :param: s2 Second String | |
| /// | |
| /// :returns: .DifferenceAtIndex(i) or .NoDifference | |
| public func firstDifferenceBetweenStrings(s1: NSString, s2: NSString) -> FirstDifferenceResult { |
In iOS8, Apple has changed how geo location permissions work. This gist outlines an approach to fix this so Geo will continue to work in iOS8.
Before getting started with the code change, we need to update the tiapp.xml with a few keys.
If you wish to have Geo always run, you need to add the below key. The key NSLocationAlwaysUsageDescription is used when requesting permission to use location services whenever the app is running. To enable this, add the below to the tiapp.xml:
NSLocationAlwaysUsageDescription Reason that appears in the authorization prompt
| func sumRecursively(numbers: [Int], _ acc:Int = 0) -> Int { | |
| if let head = numbers.first { | |
| let tail = Array(dropFirst(numbers)) | |
| return sumRecursively(tail, head + acc) | |
| } else { | |
| return acc | |
| } | |
| } | |
| let myNumbers = [1,2,3,4,5] |
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |