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
func setupBackButton(){ | |
var count: Int? = navigationController?.viewControllers.count | |
if count > 0 && navigationItem.leftBarButtonItem == nil{ | |
if !(navigationController?.viewControllers.first === self) { | |
self.navigationItem.leftBarButtonItem = HSAppearance.barButtonWithTitle("BACK", image:UIImage(named:"ArrowLeft"), target: self, action: "HSBackAction:") | |
} | |
} | |
} | |
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
func centerMapWithCoords(coordsArr:[CLLocationCoordinate2D]){ | |
var zoomRect:MKMapRect = MKMapRectNull; | |
for coord:CLLocationCoordinate2D in coordsArr { | |
var annotationPoint: MKMapPoint = MKMapPointForCoordinate(coord) | |
var pointRect:MKMapRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0) | |
zoomRect = MKMapRectUnion(zoomRect, pointRect) | |
} | |
mapView.setVisibleMapRect(zoomRect, edgePadding:UIEdgeInsetsMake(150, 30, 30, 30), animated:false) |
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
require "open-uri" | |
require "json" | |
class RuteoApp | |
def batman(env) | |
[200, {"Content-Type" => "text/plain"}, "El Guason"] | |
end | |
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
def algo(env) | |
data_raw = open('http://spreadsheets.google.com/tq?key=0AsTunpthKrMxdEp5R1loYjBBcVhNQWVEc1BUZmZ1QUE&pub=1') | |
data = data_raw.read | |
data = data.split('(')[1].split(")")[0] | |
data = data.gsub("'", '"') | |
data = data.gsub(/([a-z]+):/, '"\1":') | |
result = JSON.parse(data) |
NewerOlder