Skip to content

Instantly share code, notes, and snippets.

Avatar

Kettle. kettleio

View GitHub Profile
@kettleio
kettleio / latlon.js
Created May 13, 2016
Coordinates library
View latlon.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2012 */
/* - www.movable-type.co.uk/scripts/latlong.html */
/* */
/* Sample usage: */
/* var p1 = new LatLon(51.5136, -0.0983); */
/* var p2 = new LatLon(51.4778, -0.0015); */
/* var dist = p1.distanceTo(p2); // in km */
/* var brng = p1.bearingTo(p2); // in degrees clockwise from north */
/* ... etc */
@kettleio
kettleio / app.js
Created May 13, 2016
Compass controller
View app.js
.controller('compassCtrl', function($scope, $ionicPlatform, Location) {
$scope.$on('$ionicView.afterLeave', function(){
console.log("Before leaving clear the compass");
if(positionTimerId) navigator.geolocation.clearWatch(positionTimerId);
if(compassTimerId) navigator.compass.clearWatch(compassTimerId);
});
$scope.location = Location.get();
console.log($scope.location);
@kettleio
kettleio / app.js
Last active May 13, 2016
Map Controller - Cordova Watch App
View app.js
.factory('Location', function() {
var position = {
lat: '',
lng: ''
};
var get = function(){
return position;
}
View startup.sh
#Install Dependencies
$ apt-get install python-scipy
$ apt-get install python-pip
$ pip install moviepy
$ pip install python-dotenv
$ pip install futures
$ pip install boto
$ pip install --allow-external mysql-connector-python mysql-connector-python
#Install forever
You can’t perform that action at this time.