Skip to content

Instantly share code, notes, and snippets.

View pmallory's full-sized avatar

Philip Mallory pmallory

View GitHub Profile
@pmallory
pmallory / benchmark.py
Created May 17, 2012 01:18 — forked from evan2m/benchmark.py
Benchmark counters in python
import timeit
from shakespeare import LETTERS, WORDS
if __name__ == '__main__':
# dict
t = timeit.Timer(stmt="""
counter = dict()
for k in LETTERS:
@pmallory
pmallory / gist_line_numbers.css
Created February 8, 2012 20:50
CSS to add line numbers to embedded gists
/* gist formatting */
.line {
background-color: #f1fafb;
}
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;