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
/*! | |
* Parse JavaScript SDK | |
* Version: 1.3.2 | |
* Built: Fri Nov 21 2014 16:31:10 | |
* http://parse.com | |
* | |
* Copyright 2014 Parse, Inc. | |
* The Parse JavaScript SDK is freely distributable under the MIT license. | |
* | |
* Includes: Underscore.js |
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
function download(localFile, remoteFile, name){ | |
var progressBar = Titanium.UI.createProgressBar({ | |
width: "80%", //describes the width | |
height:50, //describes the height | |
bottom: "25%", | |
min:0, //Minimum position | |
max:1, //Maximum value for the progress | |
value:0, | |
color: '#fff', | |
message: 'Downloading ' + name + '...', |
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
/*! | |
* Parse JavaScript SDK | |
* Version: 1.5.0 | |
* Built: Fri Jul 10 2015 17:05:46 | |
* http://parse.com | |
* | |
* Copyright 2015 Parse, LLC | |
* | |
* Includes: Underscore.js | |
* Copyright 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. |
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 | |
* | |
*/ | |
/** |
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
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
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
//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
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
// | |
// 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 |
OlderNewer