Skip to content

Instantly share code, notes, and snippets.

View michaelsteffen's full-sized avatar

Michael Steffen michaelsteffen

View GitHub Profile
@michaelsteffen
michaelsteffen / index.html
Created December 6, 2014 20:20
Mabox GL-JS zero transition demo
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.4.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.4.2/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@michaelsteffen
michaelsteffen / basemap.mss
Created December 3, 2014 00:32
Styles for a Mapbox Studio map of bike ride data
// Common Colors //
@water: #456;
#road, #bridge {
line-color: #abc;
comp-op: soft-light;
opacity: 0.75;
}
#mapbox_satellite_full,
@michaelsteffen
michaelsteffen / clean_gpx.py
Created December 3, 2014 00:21
Simple script to clean GPX output from a Garmin cycling computer.
# Must be run with lxml installed to process larger data sets.
# By default looks for ./RawGPX.gpx as the input file and outputs to ./CleanedGPX.gpx. But of course one could change that easily...
import gpxpy
import gpxpy.gpx
import re
def get_furthest_point_above_speed(track, start_segment_no, start_point_no, speed, shortest_length=500):
"""
Starting from a given point on a track, finds the longest subsection of the track