I hereby claim:
- I am dgouldin on github.
- I am dgouldin (https://keybase.io/dgouldin) on keybase.
- I have a public key whose fingerprint is 0864 6C45 4C16 F447 D49C 33CD 42A6 BBC2 87C3 0C5A
To claim this, I am signing this object:
from __future__ import division | |
import json | |
import os | |
import urlparse | |
from collections import defaultdict | |
from datetime import datetime | |
from dateutil.relativedelta import relativedelta | |
from requests import HTTPError | |
from requests_oauthlib import OAuth1Session |
require("babel/register"); | |
var Imap = require('imap'); | |
var imap = new Imap({ | |
user: process.env.USERNAME, | |
password: process.env.PASSWORD, | |
host: 'imap.gmail.com', | |
port: 993, | |
tls: true | |
}); |
#!/usr/bin/env python | |
from xml.etree import ElementTree | |
import requests | |
import unicodecsv as csv | |
import sys | |
url = "http://en.wikipedia.org/wiki/List_of_Game_of_Thrones_characters" | |
response = requests.get(url) | |
def get_characters(table): |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from requests import Session | |
from requests.adapters import BaseAdapter | |
from requests.auth import HTTPBasicAuth | |
from requests.models import Response | |
from suds.properties import Unskin | |
from suds.transport import Transport, TransportError, Reply |
def index_of_first(iterable, value): | |
match_func = value if callable(value) else (lambda x: x == value) | |
for index, item in enumerate(iterable): | |
if match_func(item): | |
return index | |
raise ValueError('Value not found') |
from collections import OrderedDict | |
def groupby_unsorted(iterable, key=None): | |
''' | |
An implementation of itertools.groupby which eager evaluates groups and | |
therefore does not require its iterable to be pre-sorted. Groups are | |
returned in the order they are seen. | |
''' | |
key = key or (lambda x: x) | |
groups = OrderedDict() |
I hereby claim:
To claim this, I am signing this object:
- 12oz bag of Ritual coffee (or a bag of Samovar tea for tea drinkers)
- 1 Dandelion chocolate bar (any origin)
- 90g bag of Dang toasted coconut chips
- 8oz bag of CC Made spiced almond caramel popcorn
- 1 Boccalone soppressata salumi
- 1 regular sized bag of 4505 Meats chicharrones
- 4pc Recchiuti salted caramels
try: | |
from django.contrib.auth import get_user_model | |
except ImportError: | |
from django.contrib.auth.models import User as UserModel | |
else: | |
UserModel = get_user_model() |
from django.contrib.auth.models import User | |
user_ids = list(User.objects.values_list('id', flat=True)[:10]) | |
reverse_user_ids = user_ids[::-1] | |
values_str_parts = ['(%s, %s)' % (i, id) for i, id in enumerate(reverse_user_ids)] | |
values_str = 'VALUES %s' % ' '.join(values_str_parts) | |
users = User.objects.raw(""" | |
SELECT u.* | |
FROM auth_user AS u | |
JOIN (%s) AS i (ordering, id) on u.id = i.id |