Skip to content

Instantly share code, notes, and snippets.

@tylerdave
tylerdave / keybase.md
Created May 29, 2016 20:39
keybase verification

Keybase proof

I hereby claim:

  • I am tylerdave on github.
  • I am tylerdave (https://keybase.io/tylerdave) on keybase.
  • I have a public key whose fingerprint is E6F7 DEB7 BE04 9C44 D6F0 CFF9 CAF1 D82B AC5A 918F

To claim this, I am signing this object:

@tylerdave
tylerdave / Nest API Example.ipynb
Last active January 6, 2022 22:34
Nest API Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tylerdave
tylerdave / setup-statsd-centos.sh
Last active August 29, 2015 13:57 — forked from GregMefford/setup-statsd-centos.sh
Basic install and setup for Bucky (statsd replacement) on CentOS. This is a work in progress.
# I'm starting with a clean CentoOS 6.5 install on Rackspace Cloud (which includes EPEL by default.)
# Install yum packages
# TODO: Install Python stuff into virtualenv rather than from yum packages
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached python-bucky
# ===== BEGIN MANUAL STEP =====
# run syncdb to setup the db and prime the authentication model (if you're using the DB model)
python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
# ===== END MANUAL STEP =====
@tylerdave
tylerdave / gist:6227791
Created August 14, 2013 03:34
resolve redirected URLs (max one redirect)
import requests
def _resolve_redirected_url(url):
response = requests.get(url, allow_redirects=False)
if response.status_code in [301, 302, 307, 308] and 'location' in response.headers:
url = response.headers['location']
return url
import time
class Retry(object):
default_exceptions = (Exception)
def __init__(self, tries, exceptions=None, delay=0):
"""
Decorator for retrying function if exception occurs
tries -- num tries
exceptions -- exceptions to catch