Skip to content

Instantly share code, notes, and snippets.


John J Czaplewski jczaplew

View GitHub Profile
View index.html
<div id="hierarchy"></div>
<script src=""></script>
<script src=""></script>
<script type="text/template" id="recursive-partial">
View hierarchy.js
"buildTaxonHierarchy": function(data) {
var occurrenceTree = {"phyla": []};
// Some preproccessing
data.records.forEach(function(d) {
d.rank = (d.rnk) ? taxaBrowser.rankMap(d.rnk) : "Unknown";
d.itallics = (d.rnk < 6) ? "itallics" : "";
d.old_name = (d.tna.split(" ")[0] != d.idt) ? d.tna : "";
d.display_name1 = (d.tna === (d.idt + " " + d.ids)) ? d.tna : d.idt;
d.display_name2 = (d.tna === (d.idt + " " + d.ids)) ? d.tna : d.ids;
jczaplew /
Created Feb 25, 2014
Fun with PostGIS

Fun with PostGIS, or, how Kanye sees the world.

jczaplew / index.html
Created May 6, 2014
Vanilla Responsive SVG
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
#content {
border:2px solid #d0d0d0;
border-radius: 5px;
jczaplew /
Created May 12, 2014
GNU Screen Cheatsheet

GNU Screen Cheatsheet

Following the syntax of this tutorial C-a = Control + a

Command Description
screen Start screen
C-a c Create a new window
C-a n Switch to next window
C-a p Switch to previous window
jczaplew /
Created May 14, 2014
Install MySQLdb on Mavericks
sudo su
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install MySQL-python
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
jczaplew / test.js
Last active Aug 29, 2015
JS Scopes
View test.js
var test = {
a: function() {
console.log("function a");
b: function(a) {
c: function() {
jczaplew / index.js
Created Jul 15, 2014
Point on line
View index.js
/* Largely borrowed from the excellent Turf.js */
function distance(a, b) {
function toRadians(degree) {
return degree * Math.PI / 180;
var R = 57.2957795,
dLat = toRadians( -,
dLon = toRadians(b.lng - a.lng);
jczaplew /
Created Jul 24, 2014
Terms of Use

Terms of Use: By using X, you acknowledge and agree that X and all of the data contained in X belongs exclusively to X Inc. and is protected by copyright and other law. X is provided solely for the personal, non-commercial use of current and prospective Aetna members and providers. Use of any robot, spider or other intelligent agent to copy content from X, extract any portion of it or otherwise cause X to be burdened with unwarranted high access or transaction activity is strictly prohibited. Aetna reserves all rights to take appropriate civil, criminal or injunctive action to enforce these terms of use.

jczaplew /
Last active Aug 29, 2015
Install QGIS OS X
#! /bin/bash
cd ~
curl "" -o "GDAL_Complete-1.11.dmg"
hdiutil mount GDAL_Complete-1.11.dmg
sudo installer -pkg /Volumes/GDAL\ Complete/NumPy.pkg -target /
sudo installer -pkg /Volumes/GDAL\ Complete/GDAL\ Complete.pkg -target /
diskutil unmount /Volumes/GDAL\ Complete
rm GDAL_Complete-1.11.dmg