Skip to content

Instantly share code, notes, and snippets.

@abkfenris
abkfenris / SWarm.ipynb
Last active September 30, 2016 20:42
SWarm model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abkfenris
abkfenris / forecast.yml
Last active December 30, 2015 19:14
Avalanche forecast and discussion in YAML
- date: 20151229
- forecasters:
- Alex Kerney
- problems:
- 1:
- problem: Deep Slab
- elevations: # how worried are we about this problem at different elevations and aspect
- below:
- n: high
- ne: considerable
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abkfenris
abkfenris / focal_counter.py
Created September 22, 2015 12:33
Focal Lengths for large directory structures
"""
Uses Celery and Redis to walk over large file structures and find focal lengths before generating a bokeh plot.
With about 32 GB of predominatly 12 MP Raw photos on PCIe SSD:
- Takes about 2.7 seconds to walk and dispatch tasks
- Takes about 192 seconds for celery to work it way through reading each photo
With about 600 GB of predominantly 12 MP Raw photos on 2TB Firewire 800 7200 RPM Drive:
- Takes about 125 seconds to initially walk and dispatch the celery tasks
- And about 7700 seconds for celery to read each one.
@abkfenris
abkfenris / Photo Focal Lengths.ipynb
Created September 21, 2015 14:29
Finding focal lengths used in a set of files in python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abkfenris
abkfenris / Slaughterhouse Nine.ipynb
Last active September 11, 2015 04:19
Nested If-Else Issues
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abkfenris
abkfenris / gist:794c51b1ba0d7f41e9a2
Created March 14, 2015 22:33
Class based API Client
from itsdangerous import JSONWebSignatureSerializer
import requests
class AuthenticationError(Exception):
"""
Failed to authenticate with server
"""
def __init__(self, arg):
self.args = arg
from models import Contact, Task
# not real, but to give you an idea
from email import SendMail
# email client with server info
client = SendMail('abc@def.com', 'password', 'mail.def.com')
# get all the contacts
for contact in Contact.select():
@abkfenris
abkfenris / Earthquake3.ipynb
Created August 7, 2014 13:59
Earthquake 3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abkfenris
abkfenris / Earthquake 2.ipynb
Last active August 29, 2015 14:05
Earthquake SearchResearch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.