This file contains 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
#!/bin/sh | |
set -e | |
set -x | |
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) | |
do | |
npm -g install "$package" | |
done |
This file contains 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
#!/bin/bash | |
# https://gist.github.com/949831 | |
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
# command line OTA distribution references and examples | |
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
var request = require('request'), | |
jsdom = require('jsdom'); | |
request({ | |
uri: 'http://cupsapp.com/' | |
}, function(error, response, body) { | |
if(error && response.statusCode !== 200) { | |
console.log('Error when contacting CUPS Page'); | |
} |
This file contains 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
var geocoder = require('geocoder'), | |
seqqueue = require('seq-queue'), | |
csv = require("fast-csv"), | |
fs = require('fs'), | |
stream = fs.createReadStream("pharmacy.csv");//CSV File with pharmacy data from database | |
var LookupAndPrint = function() { | |
this.queue = seqqueue.createQueue(1000); | |
}; | |
LookupAndPrint.prototype.cl = function(addr, data) { |
This file contains 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
// Simple implementation (not thread-safe) | |
+ (Singleton *) sharedSingleton | |
{ | |
static Singleton *instance; | |
if (nil == instance) | |
{ | |
instance = [self new]; | |
} | |
return instance; | |
} |
This file contains 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 <CoreLocation/CoreLocation.h> | |
CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1]; | |
CLLocation *locB = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; | |
CLLocationDistance distance = [locA distanceFromLocation:locB]; | |
//Distance in Meters | |
//1 meter == 100 centimeter |
This file contains 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
There is no native compass UIView. In order to use the magnetometer, you'll have to use CoreLocation and the following delegate method: | |
- (void) locationManager:(CLLocationManager *)manager | |
didUpdateHeading:(CLHeading *)newHeading | |
to rotate a UIView to point North (bearingView is a UIImageView): | |
float heading = newHeading.magneticHeading; //in degrees | |
float headingDegrees = (heading*M_PI/180); //assuming needle points to top of iphone. convert to radians | |
self.bearingView.transform = CGAffineTransformMakeRotation(headingDegrees); |
This file contains 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
{ | |
"installed_packages": | |
[ | |
"Alignment", | |
"All Autocomplete", | |
"AutoFileName", | |
"Autoprefixer", | |
"BracketHighlighter", | |
"DocBlockr", |
This file contains 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() { | |
var GeoConverter; | |
GeoConverter = (function() { | |
var EARTH_MILES = 24902, | |
EARTH_KM = 40076, | |
DEGREE_KM = EARTH_KM / 360, | |
DEGREE_MI = EARTH_MILES / 360, | |
DEGREE_M = DEGREE_KM * 1000, | |
MILE_METER = 1609.34, | |
RADIAN_DEGREE = 57.2957795; |
OlderNewer