Skip to content

Instantly share code, notes, and snippets.

import sys
import re
def iterwords(fh):
for number, line in enumerate(fh):
for word in re.split(r'\s+', line.strip()):
# Preprocess the words here, for example to strip out punctuation
# (the following example is sloooow, compile this regex if you
# really want to use it):
class A(object):
access_counter = 0
def __init__(self, attr):
self._attr = attr
@classmethod
def print_stats(cls):
print "Attribute accessed {0} times".format(cls.access_counter)
@GaretJax
GaretJax / gist:1166822
Created August 23, 2011 22:48 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Computer science student (HPC & Distributed computing)
Favorite Python project: Twisted
Favorite Conference: PyConf
Python Experience Level: Expert
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GnuTLS configure 2.12.16, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --disable-guile --disable-static --prefix=/usr/local/Cellar/gnutls/2.12.16 --with-libgcrypt --without-p11-kit
## --------- ##
## Platform. ##
==> Downloading http://ftpmirror.gnu.org/gnutls/gnutls-2.12.16.tar.bz2
File already downloaded in /Users/garetjax/Library/Caches/Homebrew
/usr/bin/tar xf /Users/garetjax/Library/Caches/Homebrew/gnutls-2.12.16.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --disable-guile --disable-static --prefix=/usr/local/Cellar/gnutls/2.12.16 --with-libgcrypt --without-p11-kit
./configure --disable-debug --disable-dependency-tracking --disable-guile --disable-static --prefix=/usr/local/Cellar/gnutls/2.12.16 --with-libgcrypt --without-p11-kit
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
% Preamble
\newcounter{mseaindex}
\newcounter{mseacount}
\newcommand{\addauthor}[1]{%
\listadd{\authors}{#1}
\stepcounter{mseacount}
}
\newcommand{\fmtauthor}[1]{#1}
\newcommand{\lineslist}[1]{#1\\}
\newcommand{\authorlines}{%
Level 1
-------
xxxxxxxxxx *+
O xxx#==
= xxxxxxx
x x#xxxxxxxxxx
xxx#xxxxxxxxxx
S #xxxxxxxxxx
"""
Usage: python asm-graph.py ASM-FILE-PATH IMAGE-OUTPUT-PATH
"""
import sys
import collections
import yapgvb as pgv
import re
SHOW_ADDR = True
#!/usr/bin/env python2.7
"""
Ready to play some command-line pitman levels?
Usage: python pitman.py LEVEL-NUMBER
LEVEL-NUMBER: An integer between 1 and 5 (inclusive) to indicate the
level you want to play.
Usage on on Windows may require a different command and was not tested
#!/bin/bash
# Drop this file in the osg sources root directory and execute it either
# by direct invocation (chmod +x needed) or by sourcing it
if [ ! -e /Developer ] ; then
sudo ln -fs /Applications/Xcode.app/Contents/Developer /Developer
fi
if [ ! -e /Developer/Applications/Xcode.app ] ; then