This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.py[co] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IndexProxy(object): | |
""" | |
Proxies access to a multidimensional sequence. | |
When the constructor is provided with a sequence of dimension N, | |
item access with iterables of length <= N will retrieve the subsequence | |
or item at the depth corresponding to the distance. For example: | |
ip = IndexProxy(multiseq) | |
ip[1,4] == multiseq[1][4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Extract all attachments from MS Outlook '.eml' file EML_FILE into | |
directory OUTPUT_DIR. If OUTPUT_DIR does not exist, it will be | |
created. | |
Usage: extract_attachments.py EML_FILE OUTPUT_DIR | |
""" | |
from __future__ import print_function | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slugs = ['unipain', 'pyiter', 'pypackages', 'pytest0', 'ircbot'] | |
print('\n'.join('http://bit.ly/{0}'.format(slug) for slug in slugs)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import requests | |
SPACEPASTE_URL = 'http://bpaste.net/' | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
'file', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registry = {} | |
def registered(cls): | |
registry[cls.__name__] = cls | |
return cls | |
@registered | |
class Foo(object): | |
def introduce(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Release Me (The Fear) | |
as performed by Cas Haley (arrangement, maybe song?) | |
https://www.youtube.com/watch?v=zRgvtu62sYQ | |
A#m Ddim7 D#m9 G# F# D#m C# Fm | |
e|---1------x-1----x------4------2------6------4------1---| | |
B|---2------6-0----6------4------2------7------6------1---| | |
G|---3------4-1----6------5------3------8------6------1---| | |
D|---3------6-0----4------6------4------8------6------3---| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _Transform: | |
transform = None | |
transargs = () | |
def __call__(self, image): | |
""" | |
Run the transformation and return the tranformed image data | |
""" | |
args = [getattr(self, arg) for arg in self.transargs] | |
return self.transform(image, *args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.pantsareoverrated.com/archive/2011/05/10/hobbes-and-bacon/ | |
http://www.pantsareoverrated.com/archive/2011/05/12/hobbes-and-bacon-002/ | |
http://www.pantsareoverrated.com/archive/2011/10/11/hobbes-and-bacon-03-2/ | |
http://www.pantsareoverrated.com/archive/2011/10/13/hobbes-and-bacon-04-2/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.py[co] |
OlderNewer