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 -eEx | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Usage: $0 local-alias http://host/path/to/svn/project" | |
exit 1 | |
fi | |
SVN_ALIAS=$1 | |
SVN_PATH=/var/www/svn/$1 | |
SVN_URL=$2 |
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
""" | |
For tracemalloc see: https://github.com/wyplay/pytracemalloc | |
Quick apply guide (ubuntu):: | |
apt-get source python2.7 | |
cd python2.7-2.7.3 | |
patch -p1 < ../pytracemalloc/python2.7_track_free_list.patch | |
debuild -us -uc | |
cd .. |
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
.builds | |
celeryd*.log | |
celeryd*.pid | |
*.deb | |
*.komodoproject | |
.komodotools | |
./*.log | |
:memory | |
./*.pid | |
.pip-cache |
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
2013-04-21 20:37:53: Top 5000 allocations per file and line | |
#1: .../site-packages/kombu/serialization.py:74: size=77407 KiB, count=11559 (+0), average=6 KiB | |
#2: .../site-packages/amqp/method_framing.py:68: size=76325 KiB, count=1684 (+0), average=45 KiB | |
#3: .../site-packages/amqp/connection.py:124: size=1903 KiB, count=1814 (+0), average=1 KiB | |
#4: .../celery/bin/celery.py:79: size=1165 KiB, count=11019 (+0), average=108 B | |
#5: .../python2.7/encodings/utf_8.py:16: size=1020 KiB, count=30328 (+0), average=34 B | |
#6: .../site-packages/amqp/serialization.py:446: size=890 KiB, count=26292 (+0), average=34 B | |
#7: .../site-packages/amqp/serialization.py:121: size=876 KiB, count=27077 (+0), average=33 B | |
#8: .../site-packages/amqp/serialization.py:199: size=852 KiB, count=3515 (+0), average=248 B | |
#9: .../site-packages/amqp/channel.py:94: size=817 KiB, count=48 (+0), average=17 KiB |
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
// Because sometimes you need to style the cursor's line. | |
// | |
// Adds an option 'styleActiveLine' which, when enabled, gives the | |
// active line's wrapping <div> the CSS class "CodeMirror-activeline", | |
// and gives its background <div> the class "CodeMirror-activeline-background". | |
(function() { | |
"use strict"; | |
var WRAP_CLASS = "CodeMirror-activeline"; | |
var BACK_CLASS = "CodeMirror-activeline-background"; |
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 os | |
import time | |
import itertools | |
import socket | |
import tempfile | |
name = tempfile.mktemp('.sock') | |
sr, ss = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM) | |
pids = [] |
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
# celery and it's dependencies | |
amqp==1.0.8 | |
anyjson==0.3.3 | |
kombu==2.5.6 | |
python-dateutil==1.5 | |
billiard==2.7.3.21 | |
celery==3.0.15 |
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 Highlander(type): | |
immortal = None | |
def __call__(cls, *args, **kwargs): | |
if cls.immortal is not None: | |
raise RuntimeError("THERE CAN BE ONLY ONE !") # You cannot make more than 1 instance of a Highlander class, it's too dangerous to have 2 ! | |
cls.immortal = super(Highlander, cls).__call__(*args, **kwargs) | |
return cls.immortal | |
class MacLeod(object): |
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 Highlander(type): | |
born = False | |
def __call__(cls, *args, **kwargs): | |
if cls.born: | |
raise RuntimeError("THERE CAN BE ONLY ONE !") # You cannot make more than 1 instance of a Highlander class, it's too dangerous to have 2 ! | |
cls.born = man = super(Highlander, cls).__call__(*args, **kwargs) | |
return man | |
class MacLeod(object): |
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
""" | |
Run: | |
python xeon.py worker -Q q0 | |
python xeon.py worker -Q q1 | |
python xeon.py worker -Q q2 | |
python xeon.py worker | |
python xeon.py produce-test | |
""" | |
import sys |