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
/** | |
Uploads a tileset (tested with shapefile.zip) to Mapbox S3 (required), | |
then triggers an API request to Mapbox to create/update the tileset | |
Usage: | |
node uploadToMapBoxTileset.js [path/to/file.zip] [tilesetId] [Tileset Title] | |
Pro tip: Don't foget to change {username} and {access_token} and/or hardcode the process.argv[] values. |
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
container_commands: | |
001installs: | |
command: "sudo yum-config-manager --enable epel" | |
setup_gdal: | |
command: cd /home/ec2-user/gdal-1.11.2/swig/python && /opt/python/run/venv/bin/python setup.py install |
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
// | |
// Generate EXIF GPS metadata | |
// Swift 3 | |
// Exif Version 2.2.0.0 supports decimal degrees | |
import Foundation | |
import CoreLocation | |
import ImageIO | |
extension CLLocation { |
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
// | |
// Screenshot.swift | |
// | |
// 1) Take a picture of a UIView | |
// 2) Take a picture of a UIView's subframe. EG. Fullscreen UIView with a | |
// small square box in the middle, it will only save what's visible in the box frame | |
// but not the box itself | |
import Foundation | |
import UIKit |
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 | |
//You have to create a bridging header in your project containing: | |
// #import <CommonCrypto/CommonHMAC.h> | |
extension String { | |
func digestHMac256(_ key: String) -> String! { | |
let str = self.cString(using: String.Encoding.utf8) |
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
//Swift 3 - Slippy Map Tile Counter | |
import UIKit | |
import CoreLocation | |
private func long2tile(lon: Double, zoom: Int) -> Int { | |
let z = Double(zoom) | |
return Int(floor((lon+180) / 360 * pow(2.0, z))) | |
} | |
private func lat2tile(lat: Double, zoom: Int) -> Int { | |
let z = Double(zoom) |
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
exports.createView = function(args) { | |
var imageView = Ti.UI.createImageView(args); | |
imageView.setMaxImage = function(url, maxWidth, maxHeight){ | |
var preview = Ti.UI.createImageView(); | |
Ti.API.info("ImageView's width = " + imageView.getWidth()); | |
preview.addEventListener('load', function(e){ | |
Ti.API.info("Loaded preview, resizing..."); | |
var ratioX = imageView.getWidth() / image.width(); //hardcoded to imageView's max width since this is static to my needs, change for full functionality |
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
NSArray *features = [geoJson valueForKey:@"features"]; | |
NSMutableArray *tempArray = [[NSMutableArray alloc] init]; | |
NSUInteger l = [features count]; | |
NTGeoJSONGeometryReader* geoJsonReader = [[NTGeoJSONGeometryReader alloc] init]; | |
for (int i=0; i<l; i++) { | |
NSDictionary* feature = [features objectAtIndex:i]; |
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
{"type": "FeatureCollection", "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, "features": [{"geometry": {"type": "MultiLineString", "coordinates": [[[-106.060845, 39.281545], [-106.061356, 39.281166], [-106.061917, 39.280773], [-106.062234, 39.280546], [-106.06255, 39.280312], [-106.062985, 39.280028], [-106.063513, 39.279824], [-106.064143, 39.279826], [-106.064553, 39.279797], [-106.06522, 39.279657], [-106.065821, 39.279575], [-106.066613, 39.279411], [-106.067253, 39.279291], [-106.067617, 39.279123], [-106.067811, 39.278864], [-106.068009, 39.278308], [-106.068335, 39.278105], [-106.069582, 39.277602], [-106.070662, 39.277396], [-106.071755, 39.277545], [-106.072715, 39.277826], [-106.074001, 39.278185], [-106.075039, 39.278314], [-106.076879, 39.278232], [-106.077382, 39.278213], [-106.077947, 39.27819], [-106.07869, 39.27815], [-106.079258, 39.278123], [-106.080154, 39.278101], [-106.081174, 39.278117], [-106.082774, 39.27816], [-106.084699, 39.278236], [-106.086484, 39.278467], [-106.087 |
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
/** | |
* twitter: @aaronksaunders | |
* | |
* See more Appcelerator Information on Company Blog | |
* | |
* blog.clearlyinnovative.com | |
* | |
*/ | |
/** |