This file contains 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
akx@monolith:/tmp$ virtualenv django-venv | |
New python executable in django-venv/bin/python | |
Installing distribute..................................................................................................................................................................................done. | |
akx@monolith:/tmp$ . django-venv/bin/activate | |
(django-venv)akx@monolith:/tmp$ pip install django | |
Downloading/unpacking django | |
Downloading Django-1.4.3.tar.gz (7.7Mb): 7.7Mb downloaded | |
Running setup.py egg_info for package django | |
Installing collected packages: django | |
Running setup.py install for django |
This file contains 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
<foo> | |
<bar baz="quux"/> | |
<derp>and some content | |
<nested/> | |
<nested-too/> | |
</derp> | |
</foo> |
This file contains 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 uWSGICacheBackedDict(object): | |
def __init__(self, prefix=""): | |
self.prefix = prefix | |
def __getitem__(self, key): | |
value = uwsgi.cache_get(self.prefix + str(key)) | |
if value is None: | |
raise KeyError(key) | |
return value | |
This file contains 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
import xmlrpclib | |
s = xmlrpclib.ServerProxy('http://localhost:3040') | |
print s.pow(2,3) | |
print s.sum([2,3]) | |
print s.system.listMethods() |
This file contains 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
import xmlrpclib | |
s = xmlrpclib.ServerProxy('http://localhost:58080') | |
print s.system.listMethods() | |
print s.pow(2,3) | |
print s.sum([2,3]) | |
print s.hello("world") |
This file contains 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
#!/bin/bash | |
curl -s -o /tmp/heta.wav http://www.bitlips.fi/tts/`curl -s "-Finput=$1" -Fvox=1 -Ffx=5 -Fspeed=-2 http://www.bitlips.fi/tts/demo.cgi | grep -oE "tmp.+?wav"` | |
[ -f /usr/bin/afplay ] && /usr/bin/afplay /tmp/heta.wav || sox /tmp/heta.wav -d |
This file contains 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
import ctypes, win32con, functools | |
U = ctypes.windll.user32 | |
EnumWindows = U.EnumWindows | |
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)) | |
GetWindowText = U.GetWindowTextW | |
RealGetWindowClass = U.RealGetWindowClass | |
IsWindowVisible = U.IsWindowVisible | |
PostMessage = U.PostMessageW | |
WM_CLOSE = 16 |
This file contains 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
# Inspired by http://rarlindseysmash.com/posts/stupid-programmer-tricks-and-star-wars-gifs | |
# via https://news.ycombinator.com/item?id=6633490 | |
# Requires | |
# * a reasonably recent ffmpeg suite | |
# * Graphicsmagick or ImageMagick | |
# * optionally: Gifsicle | |
# * an input video file | |
# Usage: | |
# python gifgif.py a_video_file.avi |
This file contains 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
import cairocffi as cairo | |
import hashlib | |
from cStringIO import StringIO | |
from collections import Counter | |
import threading, sys, traceback, time | |
class ImageGenerator(object): | |
def __init__(self, text): | |
self.text = text |
This file contains 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
These were run on a Windows XP x32 virtual machine. | |
Python 2.5: | |
HEAD broken due to ctypes changes | |
#230 broken due to ctypes changes | |
Python 2.6: | |
HEAD broken re agent authentication | |
#230 works | |
Python 2.7 | |
HEAD broken re agent authentication |