Skip to content

Instantly share code, notes, and snippets.

@kjordahl
kjordahl / shake.cmd
Created August 23, 2011 22:53
Plot smoothed version of USGS Community Internet Intensity Map with GMT
#!/bin/sh
wget -O usgs.txt http://earthquake.usgs.gov/earthquakes/dyfi/events/se/082311a/us/cdi_zip.txt
gmtset COLOR_NAN white
gmtset FORMAT_GEO_MAP DF
gmtset FONT_LABEL '16p,Helvetica,black'
I=0.1
R=`awk '{FS=","; print $6, $5, $2}' usgs.txt | minmax -I1`
echo $R
N=`awk 'BEGIN{FS=","}{SUM += $3} END {print SUM}' usgs.txt`
R=-R-85/-70/34/45
@kjordahl
kjordahl / onewire.pde
Created June 1, 2011 16:48
Arduino sketch to read data from DS18x20 digital temperature sensors
/* Name: onewire.pde
Read data from multiple DS18x20 digital temperature sensors
DS18B20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2812>
DS18S20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2815>
* Detect number and type of sensors, and whether each is using parasitic power
* Gracefully handles plugging/unplugging of sensors (but will not
detect new sensors after initialization)