Skip to content

Instantly share code, notes, and snippets.


John J Czaplewski jczaplew

View GitHub Profile
jczaplew /
Last active Sep 14, 2017
Responsive TopoJSON Sizing with d3.js

States will adjust in size relative to the width of the container div, which allows SVG elements to be appropriately sized regardless of device size or screen resolution, making it a good way to integrate D3 and Bootstrap.

Click "Open in a new window", change the size of your browser window, and the states will scale with it. *Will not work in the standard view

Please let me know if there is a better/native way to do this!

jczaplew / gist:5631236
Created May 22, 2013
FOSS4GNA Presentation Links
View gist:5631236
Truck Driver example:
EIA example:
jczaplew /
Created May 30, 2013
EIA Nuclear Powerplant data scraper
## Script to scrape all nuclear powerplant data from the EIA database
## and create a CSV
## Also requires an EIA API key, which you can register for here
## John J Czaplewski | | May, 2013
import urllib2
import json
jczaplew / gist:5799404
Last active Jul 19, 2021
502 Proxy Error with Apache, Node, and MySQL
View gist:5799404
Node running on :8080
Apache running on :80
Using Apache mod_proxy to forward application requests to :8080
On client:
1. Proxy Error
The proxy server received an invalid response from an upstream server.
jczaplew / typeahead.html
Last active Apr 23, 2020
A very simple example showing how to force the Bootstrap typeahead ( to match only the start of words. The default matcher function matches the user query to any part of the possible results, which is often times undesirable - for example, in the standard typeahead in the example below…
View typeahead.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8"/>
<link href="//" rel="stylesheet"/>
<div style="padding:20px;">
<p>Standard Bootstrap typeahead</p><input placeholder='Type a country' type='text' size='22' name='countries' data-provide='typeahead'/>
View gist:6073822
var records = {
"records": [
{"oid":75,"typ":"col","lng":-95.3478,"lat":37.2236,"prc":"LS","nam":"West side of U.S. 59","rid":[12]},
{"oid":76,"typ":"col","lng":-94.7081,"lat":37.8397,"prc":"LS","nam":"Former RR cut at Formation Type Section (Fort Scott Fm., Bourbon Co., Kansas)","rid":[12]},
{"oid":77,"typ":"col","lng":-94.7039,"lat":37.8586,"prc":"MS","nam":"Abandoned strip mine (Fort Scott Fm., Bourbon Co., KS)","rid":[12]},
{"oid":82,"typ":"col","lng":-94.7864,"lat":37.7858,"prc":"MS","nam":"Jubilee quarry (Pawnee Fm., Bourbon Co., KS)","rid":[12]},
{"oid":83,"typ":"col","lng":-95.2039,"lat":37.2003,"prc":"MS","nam":"Labette Southwest (Pawnee Fm., Labette Co., KS)","rid":[12]},
{"oid":84,"typ":"col","lng":-95.2767,"lat":37.0986,"prc":"MS","nam":"Ellis school (Pawnee Fm., Labette Co., KS)","rid":[12]},
{"oid":85,"typ":"col","lng":-94.75,"lat":37.7858,"prc":"MS","nam":"Lake Fort Scott (Pawnee Fm., Bourbon Co., KS)","rid":[12]},
{"oid":94,"typ":"col","lng":-95.1689,"lat":37.4933,"prc":"MS","nam":"East side o
View index.html
<!DOCTYPE html>
body {
#clock {
jczaplew / index.html
Last active Mar 16, 2020
Using d3.behavior.drag with a map
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
body {
background: #fcfcfa;
height: 500px;
position: relative;
width: 960px;
#projection-menu {
jczaplew / countries_1e5.json
Created Sep 18, 2013
Adaptive Composite Map Projection example
View countries_1e5.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.