Skip to content

Instantly share code, notes, and snippets.

@mappingvermont
mappingvermont / road-tube-high-level.md
Last active June 3, 2026 01:32
DIY Pneumatic Road Tube Bike Counter — High-Level Plan

DIY Pneumatic Road Tube Bike Counter — High-Level Plan

Gist: https://gist.github.com/mappingvermont/d04a09258ecb0dc82eb170ef7129aa4a To update: gh gist edit d04a09258ecb0dc82eb170ef7129aa4a

How It Works

A sealed rubber air tube laid across a bike lane acts as a pressure sensor. When a bike tire rolls over it, it compresses the tube and creates a brief pressure spike at the sealed end. An electronic sensor detects this spike and counts it. Each bike produces two pulses (front and rear wheel) in quick succession.

Physical Setup

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / famous_vermonters.js
Created November 28, 2021 02:58
Extract famous vermonters and their QIDs from wikipedia
const wtf = require('wtf_wikipedia')
const rp = require('request-promise');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
const csvWriter = createCsvWriter({
path: 'famous_vermonters.csv',
header: [
{id: 'qid', title: 'qid'},
{id: 'name', title: 'name'}
]
[
{
"name": "New York",
"qid": "Q60",
"iso_3166_1": "US",
"iso_3166_2": "US-NY",
"population": 8550405.0,
"qrank": 14995035.0,
"lat": 40.7308619,
"lon": -73.9871558
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / endpoint.geojson
Last active October 22, 2024 12:07
Finding best-fit zoom level given a shapely geometry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / format_election_results.py
Last active January 23, 2020 19:12
script to format tabular election CSV to GIS attribute table - all joining to county FIPS code
import pandas as pd
import geopandas as gpd
def clean_source_data():
df = pd.read_csv('countypres_2000-2016.csv')
# remove year 2000 election results
df = df[df.year != 2000]
@mappingvermont
mappingvermont / cant_build_area.geojson
Created September 25, 2019 18:15
Example polygons that return null from Sieve(geom, <any_number>)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / dc_how_16th_st.geojson
Last active September 12, 2019 01:02
Houses of Worship on 16th St, DC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / stockton.geojson
Created September 9, 2019 13:44
lovely Stockton polygon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.