Skip to content

Instantly share code, notes, and snippets.

@kjordahl
kjordahl / gist:e94cb7231a67ce17cb3b
Created July 8, 2014 20:04
Texas Natural Regions notebook
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "",
"signature": "sha256:6baf5a863f7167c4155fa8824ae158ef802992daa2b13cdc3e3c756a1e761def"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
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.
@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 / 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)
"""
Test import of required and optional packages for SciPy 2015 tutorial
"""
from __future__ import print_function
import importlib
import sys
@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)
@kjordahl
kjordahl / multi_detector.py
Created February 17, 2012 15:19
multiprocessing test
#!/usr/bin/env python
'''
based on gil_detector.py
http://codepad.org/CeI6gJLk
Swapped out multiprocessing for threading
Effective use of multiple processors is done by checking how fast multiprocess code
is executed in relation to single-threaded code.
'''
@kjordahl
kjordahl / garradd.py
Created February 26, 2012 17:31
Calculate position of Comet Garradd
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
"""Calculate position for comet Garradd
Author: Kelsey Jordahl
Time-stamp: <Sun Feb 26 12:28:17 EST 2012>
License: GPLv3
"""
import ephem
@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