Skip to content

Instantly share code, notes, and snippets.

View alexbewley's full-sized avatar

Alex Bewley alexbewley

View GitHub Profile
@alexbewley
alexbewley / tesla-driving-heatmap.R
Last active April 10, 2018 15:08
Take Tesla geolocation coordinates from a postgres database and create a heat map in RStudio
#
# -- R Script to parse Tesla location metrics and plot a heatmap of where the car
# has been
# -- Needs historical data as captured by https://github.com/hjespers/teslams
# -- 2018 Alex Bewley
#
require(ggplot2)
require(ggmap)
require(RPostgreSQL)
@alexbewley
alexbewley / buildDottedTable.js
Created October 25, 2016 00:04
Convert JSON to dotted map table format
/*
-- use buildDottedTable([],"", json);
-- understands nesting of dictionaries and arrays for indexing
-- ex: d = { a : 1, b : [ { c: 2 }, { d: 3} ], e: { f: "string" } }
-- buildDottedTable([],"",d);
[ { key: 'a', val: 1 },
{ key: 'b.0.c', val: 2 },
{ key: 'b.1.d', val: 3 },
{ key: 'e.f', val: 'string' } ]
*/