This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
State | State FIPS | County FIPS | IECC Climate Zone | IECC Moisture Regime | BA Climate Zone | County Name | |
---|---|---|---|---|---|---|---|
AK | 02 | 013 | 7 | N/A | Very Cold | Aleutians East | |
AK | 02 | 016 | 7 | N/A | Very Cold | Aleutians West | |
AK | 02 | 020 | 7 | N/A | Very Cold | Anchorage | |
AK | 02 | 050 | 8 | N/A | Subarctic | Bethel | |
AK | 02 | 060 | 7 | N/A | Very Cold | Bristol Bay | |
AK | 02 | 068 | 7 | N/A | Very Cold | Denali | |
AK | 02 | 070 | 8 | N/A | Subarctic | Dillingham | |
AK | 02 | 090 | 8 | N/A | Subarctic | Fairbanks North Star | |
AK | 02 | 100 | 7 | N/A | Very Cold | Haines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://djangosnippets.org/snippets/2283/ | |
from django.db import transaction | |
from django.db.models import get_models, Model | |
from django.contrib.contenttypes.generic import GenericForeignKey | |
@transaction.atomic | |
def merge_model_objects(primary_object, alias_objects=None, keep_old=False): | |
""" | |
Use this function to merge model objects (i.e. Users, Organizations, Polls, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DisableMigrations(object): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES = DisableMigrations() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_inline_form(prefix) { | |
var count = parseInt($('#id_' + prefix + '-TOTAL_FORMS').val(), 10); | |
var last_form = $('.' + prefix + ':last'); | |
var new_form = last_form.clone(false).html(last_form.html().replace( | |
new RegExp(prefix + '-\\\\d-', 'g'), prefix + '-' + count + '-')); | |
new_form.find('input[type="text"], textarea').each(function () { | |
$(this).val(''); | |
}); | |
new_form.hide().insertAfter(last_form).slideDown(300); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Timer | |
class SuicidalKey(object): | |
""" | |
>>> k = SuicidalKey("asdf",30) | |
>>> k.key | |
'asdf' | |
>>> # Before 30 seconds are up | |
>>> k.reset_expiration(30) | |
>>> # Wait 30 seconds |