Skip to content

Instantly share code, notes, and snippets.

View steinbring's full-sized avatar

Joe Steinbring steinbring

View GitHub Profile
@steinbring
steinbring / zipCodeToLatLong.csv
Created November 20, 2021 20:07
CSV file of five-digit ZIP codes and their corresponding latitude/longitude coordinates. (Source: 2021_Gaz_zcta_national.zip from https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html)
We can't make this file beautiful and searchable because it's too large.
zip,latitude,longitude
601,18.180555,-66.749961
602,18.361945,-67.175597
603,18.458497,-67.123906
606,18.158327,-66.932928
610,18.294032,-67.127156
611,18.276316,-66.807165
612,18.416727,-66.70009
616,18.420412,-66.671979
617,18.446889,-66.561154
@steinbring
steinbring / cityStateToLatLong.csv
Created November 20, 2021 19:55
CSV file of municipalities (Cities/States) and their corresponding latitude/longitude coordinates. (Source: 2021_Gaz_place_national.zip from https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html)
We can't make this file beautiful and searchable because it's too large.
state,city,latitude,longitude
AL,Abanda CDP,33.091627,-85.527029
AL,Abbeville city,31.564724,-85.259123
AL,Adamsville city,33.602315,-86.971527
AL,Addison town,34.202681,-87.178004
AL,Akron town,32.879066,-87.740899
AL,Alabaster city,33.244399,-86.847372
AL,Albertville city,34.26313,-86.21066
AL,Alexander City city,32.92724,-85.937122
AL,Alexandria CDP,33.760819,-85.872008
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function getUrlVars(url) {
var vars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function getUrlVars(url) {
var vars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function getUrlVars(url) {
var vars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
@steinbring
steinbring / index.js
Created October 16, 2021 15:01
This is the code behind the https://geolocation-json.joe.workers.dev/ cloudflare worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function getUrlVars(url) {
var vars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;

Keybase proof

I hereby claim:

  • I am steinbring on github.
  • I am steinbring (https://keybase.io/steinbring) on keybase.
  • I have a public key ASCQ9luTlJukTcAtoD216nLAbUaC17TG-XSy0-tAAXs3yQo

To claim this, I am signing this object:

@steinbring
steinbring / index.html
Created May 31, 2018 22:13
Want to do "autocomplete" for doctoral programs in a webform? Using the <datalist> tag, you can use this ...
<input list="programs" name="program" size="25">
<datalist id="programs">
<option value="Africology, PhD">
<option value="Anthropology, PhD">
<option value="Architecture, PhD">
<option value="Atmospheric Science, PhD">
<option value="Biological Sciences, PhD">
<option value="Biomedical and Health Informatics, PhD">
<option value="Chemistry, PhD">
@steinbring
steinbring / index.html
Created May 31, 2018 18:33
Want to do "autocomplete" for universities in a webform? Using the <datalist> tag, you can use this ...
<input list="universities" name="university" size="25">
<datalist id="universities">
<option value="Marquette University">
<option value="University of Wisconsin - Milwaukee">
<option value="University of Wisconsin - Madison">
<option value="University of Wisconsin - La Crosse">
<option value="Concordia University - Wisconsin">
<option value="Medical College of Wisconsin">
<option value="St. Francis Seminary">
@steinbring
steinbring / index.html
Created May 30, 2018 21:05
Want to do "autocomplete" for countries in a webform? Using the <datalist> tag, you can use this ...
<input list="countries" name="country" size="25" placeholder="country">
<datalist id="countries">
<option value="Afghanistan">
<option value="Åland Islands">
<option value="Albania">
<option value="Algeria">
<option value="American Samoa">
<option value="Andorra">
<option value="Angola">