Skip to content

Instantly share code, notes, and snippets.

View WanderingHogan's full-sized avatar
👋

Chris Hogan WanderingHogan

👋
  • colorado
View GitHub Profile
#! /usr/bin/env bash
echo "geth started"
screen -dmS geth geth --datadir "/mnt/volume_sfo2_01" --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=328 --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*"
let dataToWrite = '';
const fs = require('fs');
const testData = require('./your/takeout/file.json')
for (item in testData.locations){
let lat = String(testData.locations[item].latitudeE7).substr(0, (String(testData.locations[item].latitudeE7).length - 7)) + '.' + String(testData.locations[item].latitudeE7).substr((String(testData.locations[item].latitudeE7).length - 7))
let lng = String(testData.locations[item].longitudeE7).substr(0, (String(testData.locations[item].longitudeE7).length - 7)) + '.' + String(testData.locations[item].longitudeE7).substr((String(testData.locations[item].longitudeE7).length - 7))
dataToWrite = dataToWrite + `${testData.locations[item].timestampMs},${lat},${lng}\n`
}
const lobobj = {"success":true,"count":309,"results":[{"id":"588a67e2ce3291c5e3d5fb96","timestamp":1485465323018,"ingestTime":1485465564069,"point":{"x":49.4956991,"y":28.7091841},"type":"LOB_LOCATION","classification":{"levels":["UNCLASSIFIED"],"compartments":[],"releasabilities":[],"disseminationControls":["FOUO"]},"mappingId":"UYOR-VG-26JAN17_08912","ingestSite":"dcgstest","collectorId":"601238710","elevation":8046.72,"heading":136.62030246749572,"pitch":0.0,"roll":-0.25,"lobType":"COMINT_LOB","lineOfBearing":330.243},{"id":"588a67e2ce3291c5e3d5fb97","timestamp":1485465320185,"ingestTime":1485465564069,"point":{"x":49.4956991,"y":28.7091841},"type":"LOB_LOCATION","classification":{"levels":["UNCLASSIFIED"],"compartments":[],"releasabilities":[],"disseminationControls":["FOUO"]},"mappingId":"UYOR-VG-26JAN17_08912","ingestSite":"dcgstest","collectorId":"601238710","elevation":8046.72,"heading":136.62030246749572,"pitch":0.0,"roll":-0.25,"lobType":"COMINT_LOB","lineOfBearing":332.5768},{"id":"588a67e4ce3291c5
// modified from here https://gist.github.com/theplatapi/0a7d789afc8028a3c20b
// and various other forums and api docs
var viewer = new Cesium.Viewer('cesiumContainer', {
targetFrameRate: 60,
homeButton: false,
sceneModePicker: false,
navigationHelpButton: false,
baseLayerPicker: false,
imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
var viewer = new Cesium.Viewer('cesiumContainer');
var entity = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(-111.0, 40.0, 150000.0),
ellipse : {
semiMinorAxis : 800000.0,
semiMajorAxis : 800000.0,
height: 0,
material : new Cesium.Color(228, 240, 245, .1),
outline : true,
var viewer = new Cesium.Viewer('cesiumContainer');
var ellipsoid = viewer.scene.globe.ellipsoid;
//var pos = Cesium.Cartesian3.fromDegrees(-111.0, 40.0, 150000.0);
var lat = 39.2904;
var lng = -76.6;
function loc2wgs() {
return Cesium.Cartesian3.fromDegrees(lng, lat, 150000.0)
}

Keybase proof

I hereby claim:

  • I am wanderinghogan on github.
  • I am chrishogan (https://keybase.io/chrishogan) on keybase.
  • I have a public key ASDVcp--HA5t-vpFvUq98SribLXE68ye1wvEtWfH5lHUEAo

To claim this, I am signing this object:

@WanderingHogan
WanderingHogan / gist:a8c3d70c63048660a925
Last active March 23, 2016 05:42
gtfs creates statements
//import the gtfs data as CSV, comma delimited, headers included
CREATE TABLE stops (
stop_lat numeric,
zone_id varchar(20),
stop_lon numeric,
stop_url varchar(250),
stop_id numeric,
stop_desc varchar(250),
stop_name varchar(250),
//you need to log in to slack here: https://api.slack.com/methods/files.list/test
// generate a required token for your team
// select your username
// click 'test method'
// take note of the 'token' and 'user' url params in the example and update the script below
// this script works with node 4.1. before running, `npm i -g request`
// run it with the harmony flag - ex `node --harmony scriptname.js
// give it a few seconds in between running this script. The api is a bit slow and will take a few seconds to allow you to submit more requests
sudo apt-get install libmatchbox1 -y