Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / pudb-add-breakpoint
Created January 25, 2012 19:31
Emacs lisp code to add pudb breakpoint to a python file (add to .emacs)
;; this location is "~/.pudb-bp" in older versions of pudb
(setq pudb-bp-file (expand-file-name "~/.config/pudb/saved-breakpoints"))
(defun pudb-add-breakpoint ()
(interactive)
(append-to-file
(concat "b " buffer-file-name ":"
(nth 1 (split-string (what-line))) "\n")
nil pudb-bp-file))
(define-key py-mode-map (kbd "C-c C-t") 'pudb-add-breakpoint)
@kjordahl
kjordahl / bootstrap.ipynb
Created October 24, 2012 18:20
Gaussian process bootstrap plots in iPython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / citibike.ipynb
Last active February 16, 2017 03:13
Citibike data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / GeoSeries.ipynb
Created November 9, 2013 17:02
Working with GeoSeries in GeoPandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / GeoDataFrame.ipynb
Created November 9, 2013 17:01
working with GeoDataFrames in GeoPandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / Geocoding.ipynb
Created November 9, 2013 17:01
GeoPandas geocoding example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / dnd.js
Created July 10, 2016 02:51 — forked from johan/dnd.js
Draggable Spinny Globe from Mike Bostock's SVG Open 2011 keynote
// http://www.html5rocks.com/en/tutorials/file/dndfiles/
d3.select('svg')
.on('dragover', handleDragOver)
.on('drop', handleFileSelect)
;
function handleFileSelect() {
var event = d3.event
, files = event.dataTransfer.files // FileList object
, about = []