Skip to content

Instantly share code, notes, and snippets.

View stuartlynn's full-sized avatar

Stuart Lynn stuartlynn

  • Two Sigma
  • Brooklyn
View GitHub Profile
@stuartlynn
stuartlynn / index.html
Last active August 29, 2015 14:24
New Horizons vizulisation
<!doctype html>
<html>
<head>
<title>New Horizon's journy to Pluto</title>
<link href='http://fonts.googleapis.com/css?family=Alike' rel='stylesheet' type='text/css'>
<style>
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
@stuartlynn
stuartlynn / combine_ephemeris.rb
Created July 16, 2015 17:03
Combine NASA JPL Ephemeris for CartoDB
require 'pry'
File.open("result.csv", "w") do |results|
results.puts("body,time,lng,lat,x,y,dist")
Dir.glob("*.txt").each do |file|
body = file.split("_").first.capitalize
data = IO.read(file).split("$$SOE").last.split("$$EOE").first.split("\r")[1..-1].collect{|a| a.split(" ")}
data.each do |row|
puts row.join(",")
next if row.empty?
@stuartlynn
stuartlynn / result.csv
Created July 27, 2015 17:51
Orbital Dynamics data for New Horizons map
We can't make this file beautiful and searchable because it's too large.
body,time,lng,lat,dist
Earth,2006-Jan-01 00:00,100.3380,-0.0006,0.983353762101
Earth,2006-Jan-02 00:00,101.3576,-0.0006,0.983341378733
Earth,2006-Jan-03 00:00,102.3772,-0.0006,0.983332671746
Earth,2006-Jan-04 00:00,103.3967,-0.0007,0.983327853855
Earth,2006-Jan-05 00:00,104.4161,-0.0007,0.983327208713
Earth,2006-Jan-06 00:00,105.4354,-0.0007,0.983331061052
Earth,2006-Jan-07 00:00,106.4546,-0.0008,0.983339747474
Earth,2006-Jan-08 00:00,107.4737,-0.0008,0.983353592605
Earth,2006-Jan-09 00:00,108.4926,-0.0008,0.983372892106
@stuartlynn
stuartlynn / index.html
Created July 28, 2015 21:46
CartoCSS torque categories generator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
@stuartlynn
stuartlynn / index.html
Created July 30, 2015 18:09
Katrina Viz
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
@stuartlynn
stuartlynn / index.md
Created August 10, 2015 20:39
Mozfest geocoding session proposal
@stuartlynn
stuartlynn / postgress_eq_to_gal
Created August 17, 2015 16:39
postgress function to convert from equtorial to galactic coords
CREATE FUNCTION ra_dec_to_galactic(r float, d float)
RETURNS geometry as $$
DECLARE
ra float;
dec float;
ig float;
an float;
l0 float;
sinb float;
b float;
@stuartlynn
stuartlynn / 2015-08-19-webmapping.md
Last active September 25, 2015 02:20 — forked from auremoser/2015-08-19-webmapping.md
GDI - Webmap Workshop
@stuartlynn
stuartlynn / data.js
Created August 26, 2015 18:58
GeoJSON example for GDI
var geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.