Skip to content

Instantly share code, notes, and snippets.

vlandham /
Last active Sep 30, 2019 — forked from awoodruff/
Head Projections Remix

A quick hack on the beautifully executed projection example from Andy Woodruff. I just wanted to see them all on one screen.

Click the Open in new window button to see them all.

Novel code Inspired once again by Jason Davies.

Andy's original text:

We've all seen the projected head from Elements of map projection with applications to map and chart construction, but the authors in 1921 did not have D3 to help them show a full range of weird distorted faces. This is based on the Map Projection Transitions example by Jason Davies.

vlandham / amplitude_time_density_example.R
Created Feb 24, 2017 — forked from memoryfull/amplitude_time_density_example.R
An example of seewave::acoustat amplitude density calculation
View amplitude_time_density_example.R
# Install dependencies
#install.packages(c("fftw","tuneR","rgl","rpanel", "seewave"), repos="")
# for Fast Fourier transform (fftw) to work, install
# the fftw lib (e.g. brew install fftw)
# Load libraries
View Makefile
all: hill-relief.jpg costarica_min_topo.json
# -------------
# Relief raster
# -------------
# Notice the `zip` file requirements here have no download.
# You will need to search for them online. They are from the
# SRTM project:
# (which appears to have multiple versions of files).

Command Line Basics

Rando Stuff

Find the full path of the folder you're in


Using d3.geo.tile to display raster image tiles underneath some TopoJSON vectors, and d3.behavior.zoom for pan & zoom.

View math_demo.js
// Turning an angle into a point on a unit
// circle and then back again
// convert from degrees to radians
D2R = Math.PI / 180;
// convert from radians to degrees
R2D = 180 / Math.PI;
// our angle
angle = 30;
View index.html
<!DOCTYPE html>
<title>Testing d3.js in Leaflet.js</title>
<link rel="stylesheet" href="leaflet.css"></link>
<script src=""></script>
<script src=""></script>
<style type="text/css">
svg , g

Brushing makes more sense for quantitative dimensions. It’s possible to use a brush to select categorical values, as shown here, though I’d recommend using per-value toggles instead. This way, users can pick arbitrary sets of values, rather than being forced to pick contiguous ranges.

vlandham / gist:83f796321374eceef676
Created Nov 12, 2015 — forked from zxcvbnm4709/gist:2656197
include jQuery in Chrome Console
View gist:83f796321374eceef676
var script = document.createElement("script");
script.setAttribute("src", "");
script.addEventListener('load', function() {
var script = document.createElement("script");
}, false);
vlandham /
Created Dec 6, 2012 — forked from MoritzStefaner/
Search where people are moving in Germany
# coding: utf-8
# requires: pattern
from pattern.web import *
import csv
import sys
# yeah I know