I hereby claim:
- I am Ffisegydd on github.
- I am ffisegydd (https://keybase.io/ffisegydd) on keybase.
- I have a public key whose fingerprint is 9AC1 1D4F A243 E20B FCE4 765E 1992 4441 0DCE F242
To claim this, I am signing this object:
"""Benchmarking answers to <http://stackoverflow.com/q/29481088/1014938>.""" | |
import re | |
from collections import defaultdict | |
from functools import partial | |
from statistics import mean, median | |
from string import digits | |
from timeit import timeit |
### Python.gitignore | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
# C extensions | |
*.so | |
# Distribution / packaging |
class Connection(object): | |
def __init__(self, *args, **kwargs): | |
# Do whatever | |
def query(self, query): | |
# Accept a dictionary and then use the key-value pairs | |
# to query the database. | |
def connect(self): | |
# Connect to your database |
# These are ordered dicts because otherwise the dates end up out of order. | |
report = {'server_count_per_day': OrderedDict(), | |
'automation_count_per_day': OrderedDict(), | |
'total_server_cost': 0, | |
'total_automation_cost': 0, | |
'total': 0} |
from itertools import permutations | |
import re | |
letters = 'abc' | |
perm = set(p for n in range(1, len(letters)+1) for p in permutations(letters, n)) | |
s = r"@({})\b".format('|'.join(''.join(p) for p in perm)) |
I hereby claim:
To claim this, I am signing this object:
// ==UserScript== | |
// @name spoiler button adder (SO Chat) | |
// @namespace about:blank | |
// @include http://chat.stackoverflow.com/rooms/* | |
// @version 1.1 | |
// @grant none | |
// ==/UserScript== | |
//adds a spoiler to the input textarea. | |
//inserts it wherever your cursor is. |
import requests | |
import bs4 | |
from datetime import date, timedelta | |
transcript_url = 'http://chat.stackoverflow.com/transcript/6/{year}/{month}/{day}/0-24' | |
today = date.today() | |
day = timedelta(days=1) | |
# d = date(year=2010, month=10, day=15) | |
d = date(year=2014, month=9, day=11) |
// ==UserScript== | |
// @name revision viewer | |
// @namespace about:blank | |
// @description Adds a "revisions" button to SO's post menu | |
// @include http://stackoverflow.com/questions/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var url = document.URL; |