Skip to content

Instantly share code, notes, and snippets.

View kettleio's full-sized avatar

Kettle. kettleio

View GitHub Profile
@kettleio
kettleio / latlon.js
Created May 13, 2016 19:37
Coordinates library
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* 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 19:26
Compass controller
.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 18:50
Map Controller - Cordova Watch App
.factory('Location', function() {
var position = {
lat: '',
lng: ''
};
var get = function(){
return position;
}
#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