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.
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 = []
@kjordahl
kjordahl / l8scene2url.py
Created December 6, 2015 20:56
Get URL for a Landsat 8 scene on AWS
URL_TEMPLATE = 'http://landsat-pds.s3.amazonaws.com/L8/{path}/{row}/{id}/index.html'
def url_from_scene_id(id):
path = id[3:6]
row = id[6:9]
return URL_TEMPLATE.format(path=path, row=row, id=id)
if __name__ == '__main__':
@kjordahl
kjordahl / tweet_capture.py
Last active October 7, 2015 02:11
Capture geolocated tweets through Twitter streaming API
import requests
from requests_oauthlib import OAuth1
import json
from my_auth import APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET
# Number of tweets to capture
MAX_COUNT = 1000
# New York City
west, south, east, north = -74.26, 40.48, -73.70, 40.92
"""
Test import of required and optional packages for SciPy 2015 tutorial
"""
from __future__ import print_function
import importlib
import sys
@kjordahl
kjordahl / rectangle.py
Last active August 29, 2015 14:13
Simple traits/chaco example
import numpy as np
from traits.api import *
from traitsui.api import *
from chaco.api import Plot, ArrayPlotData
from enable.component_editor import ComponentEditor
class Rectangle(HasTraits):
width = Range(0.0, 10.0)
@kjordahl
kjordahl / ebola.ipynb
Created December 5, 2014 02:16
Ebola outbreak
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / plotting_distributions (white background).ipynb
Created November 25, 2014 21:01
Seaborn plotting distributions example on white background
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.