I hereby claim:
- I am djm on github.
- I am djm (https://keybase.io/djm) on keybase.
- I have a public key whose fingerprint is DBB9 0727 AD94 8582 ECED 66EB 7EA3 B5B0 D8AD 79BB
To claim this, I am signing this object:
import os | |
import sys | |
from os.path import basename, splitext | |
from urlparse import urlparse | |
import requests | |
from bs4 import BeautifulSoup | |
def extract_full_size_url_from_tag(image_tag): |
FROM python:2.7 | |
# Force stdin, stdout and stderr to be totally unbuffered. | |
ENV PYTHONUNBUFFERED 1 | |
# For Pillow to have freetype support. | |
RUN ln -s /usr/include/freetype2 /usr/include/freetype | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app |
# Bad | |
class Join(object): | |
""" | |
>>> join_by_commas = Join(',') | |
>>> join_by_commas(['o', 'm', 'g']) | |
'o,m,g' | |
""" | |
def __init__(self, separator=u' '): | |
self.separator = separator |
import time | |
from boto import elastictranscoder | |
REQUEST_FREQ = 0.3 # Every x seconds | |
REGION = 'eu-west-1' | |
TO_CANCEL = [ | |
'Progressing', | |
'Submitted' | |
] |
# I mean this: | |
* */12 * * * /path/to/virtualenv/bin/python /path/to/django/project/manage.py cleanup | |
# over this: | |
* */12 * * * source /path/to/virtualenv/bin/activate; /path/to/django/project/manage.py cleanup |
# Works on Scrapy v0.20 | |
from scrapy.crawler import Crawler | |
from scrapy.utils.project import get_project_settings | |
def get_spiders(): | |
""" Retrieves a dict of the spiders classes available to the current | |
scrapy keyed by their string-name. | |
""" | |
settings = get_project_settings() |
import re | |
def camelcase_to_human_readable(camel_cased_string): | |
""" Converts a string from CamelCase to Human readable. | |
e.g SuperBadRobot -> Super Bad Robot | |
""" | |
return ' '.join(re.findall("([A-Z][^A-Z]*)", camel_cased_string)).strip() | |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
import sys, subprocess, collections | |
from flake8.hooks import git_hook, get_git_param | |
# `get_git_param` will retrieve configuration from your local git config and | |
# then fall back to using the environment variables that the hook has always | |
# supported. | |
# For example, to set the complexity, you'll need to do: | |
# git config flake8.complexity 10 | |
COMPLEXITY = get_git_param('FLAKE8_COMPLEXITY', 10) |
// Get Card's last URL segment (eg 4468-fix-the-login-page): | |
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('', window.location.href.split("/").pop().split("#")[0])})() | |
// Get Card's full hash (eg 5731b92ef660293533517de9) : | |
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-export-json').attr('href').split("/")[2]); $('.js-more-menu').click();})() | |
// Get Card's unique id (board-independent, eg rKBmQeOk) : | |
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-short-url').attr('value').split("/").slice(-1)[0]); $('.js-more-menu').click();})() |