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
hardstatus alwayslastline | |
hardstatus string "%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{g}]" | |
startup_message off | |
vbell off |
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
The goal of Summer of Code is to get your project written, reviewed, and | |
ultimately merged back into Django's trunk. We want your project to | |
succeed, and we approved it because we think you've got a good chance of | |
pulling it off. | |
However, this is easier said than done. You'll need to work hard, | |
communicate effectively with the community, and pass a rigorous peer | |
review. Your mentor -- and Django's committer team in general -- will give | |
you as much support as possible, but ultimately the onus is on your | |
shoulders to get this done. |
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
# Django: validate that an uploaded file is a valid PDF | |
import pyPdf # from http://pybrary.net/pyPdf/ | |
from pyPdf.utils import PdfReadError | |
class DocumentForm(forms.ModelForm): | |
pdf = forms.FileField() | |
class Meta: | |
model = Document | |
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
#!/usr/bin/env python | |
""" | |
Regex for URIs | |
These regex are directly derived from the collected ABNF in RFC3986 | |
(except for DIGIT, ALPHA and HEXDIG, defined by RFC2234). | |
They should be processed with re.VERBOSE. | |
""" |
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 logging | |
class Silence(logging.Handler): | |
def emit(self, record): | |
pass | |
logging.getLogger("jellyroll").addHandler(Silence()) |
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
/** | |
* A simple preforking echo server in C. | |
* | |
* Building: | |
* | |
* $ gcc -Wall -o echo echo.c | |
* | |
* Usage: | |
* | |
* $ ./echo |
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
<? | |
/* | |
Simple preforking echo server in PHP. | |
Russell Beattie (russellbeattie.com) | |
PHP port of http://tomayko.com/writings/unicorn-is-unix | |
*/ | |
/* Allow the script to hang around waiting for connections. */ | |
set_time_limit(0); |
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
# Prevent pip from doing anything unless you're inside an activated virtualenv. | |
PIP=/usr/local/bin/pip | |
function pip { | |
if [ "x$VIRTUAL_ENV" = 'x' ]; then | |
echo "No virtualenv activated; bailing." | |
else | |
$PIP -E `basename $VIRTUAL_ENV` "$@" | |
fi | |
} |
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
/ | |
GET -> list of projects | |
/{project} | |
GET -> project info | |
PUT -> create new project (not req'd; created if needed) | |
DELETE -> delete project and all build info | |
/{project}/builds | |
GET -> list of recent builds; pagination for all builds |
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
cd /tmp | |
wget http://codespeak.net/lxml/lxml-2.2.2.tgz | |
tar -xzvf lxml-2.2.2.tgz | |
cd lxml-2.2.2 | |
cd libs/ | |
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz | |
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz | |
cd .. | |
python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24 | |
sudo python setup.py install |