Skip to content

Instantly share code, notes, and snippets.

View albums_nov_2017.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 4. in line 6.
3274251919,Horehound Debut Self-titled,Horehound,,,True,,2016-08-28T12:03:19.656392
1430603235,Origins,Mount Soma,,,True,,2016-08-28T12:03:19.656392
2160951328,Revenge of Swampy's Creature EP,Los Savages,,,True,,2016-08-28T12:03:19.656392
1847541816,Mrtav,Hesperian Death Horse,,,True,doom,2016-08-29T13:21:51.946040
1950657943,Jason...The Dragon,Weedeater,
import datetime
def timed_cached(timeout=60 * 60,
def outer(method_or_attribute):
if not hasattr(timed_cached, '__mapping'):
timed_cached.__mapping = {}
Ogreman /
Last active February 24, 2016 12:09
#! /usr/bin/python
import requests
import json
import click
import os
import datetime
import json
from flask import request, url_for
from flask.ext.api import FlaskAPI, status, exceptions
from werkzeug.contrib.cache import SimpleCache
app = FlaskAPI(__name__)
cache = SimpleCache()
Ogreman /
Created October 22, 2014 11:21
deduper with history of duplicates and support for hashable types
from collections import deque
def dedupe_with_history(items, key=None, history=None):
previous = deque(maxlen=history)
seen = set()
for item in items:
val = item if key is None else key(item)
if val not in seen:
yield item
Ogreman / nginx.conf
Created May 23, 2014 20:11
battle ready nginx
View nginx.conf
user www-data;
pid /var/run/;
worker_processes auto;
worker_rlimit_nofile 65000;
events {
worker_connections 2048;
multi_accept on;
use epoll;
import itertools
def name_func(var, scope=globals):
return itertools.ifilter(
lambda x: var is scope().get(x),
except StopIteration:
from __future__ import division
from __future__ import print_function
import requests
import time
from contextlib import closing
import sys
# in bytes
CHUNKS = 1024

Keybase proof

I hereby claim:

  • I am ogreman on github.
  • I am ogre ( on keybase.
  • I have a public key whose fingerprint is D715 5891 CB08 3D6A 58B3 11FC 5D46 E55E FD80 2E8F

To claim this, I am signing this object: