Skip to content

Instantly share code, notes, and snippets.

View dannythunder's full-sized avatar
🤓
On a path to know everything

dannythunder

🤓
On a path to know everything
  • Sweden
View GitHub Profile
@dannythunder
dannythunder / README.md
Created June 27, 2018 12:14 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@dannythunder
dannythunder / find_closest_scooter.js
Created May 22, 2019 09:18 — forked from olegam/find_closest_scooter.js
Scriptable app script to find closest scooter in Copenhagen
let googleApiKey = '' // Insert your own key for Google Maps + Directions JS SDK here
let copenhagenBounds = {minLat: 55.5, minLong: 12.5, maxLat: 55.8, maxLong: 12.7}
let copenhagenCenter = {lat: copenhagenBounds.maxLat - copenhagenBounds.minLat, lng: copenhagenBounds.maxLong - copenhagenBounds.minLong}
let getLocation = Location.current()
// const getLocation = new Promise(resolve => resolve({latitude: 55.7, longitude: 12.5})) // hardcoded location resolver for airplane debug use
const [allTIERScooters, allVOIScooters, myLocation] = await Promise.all([getTIERScooters(copenhagenBounds), getVOIScooters(copenhagenBounds), getLocation])
console.log('My location: ' + JSON.stringify(myLocation))
if (allTIERScooters.length + allVOIScooters.length <= 0) {