Skip to content

Instantly share code, notes, and snippets.

WIDE_PROMPT="$USERNAME_NORMAL_COLOR%n$RESET_COLOR@%{$HOSTNAME_NORMAL_COLOR%}%m%{$reset_color%}:$DARK_RED%~$RESET_COLOR%# "
NARROW_PROMPT="$USERNAME_NORMAL_COLOR%n$RESET_COLOR@%{$HOSTNAME_NORMAL_COLOR%}%m%{$reset_color%}:$DARK_RED%~$RESET_COLOR
%# "
size_prompt() {
if [ $COLUMNS -lt 85 ]; then
PROMPT=$NARROW_PROMPT
else
PROMPT=$WIDE_PROMPT
fi
def __call__(self, sender, signal, **kwargs):
form = sender
<rest of method not using sender>
Usage: javacTask <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files and annotation processors
-cp <path> Specify where to find user class files and annotation processors
# For extracting user and pass
preds = map(eq_fact, ['user_name', 'password'])
[[user_name], [password]] = pred_list_partition(preds, kwargs, False)
def eq_fact(name):
def wrapped(x):
return x == name
@OddBloke
OddBloke / layout.html
Created July 9, 2012 14:44
Add A GitHub Changelog Sidebar To Sphinx Docs
{% extends '!layout.html' %}
{% block sidebarsourcelink %}
{{ super() }}
<ul>
<li><a href="https://github.com/<user>/<repository>/commits/master/<path to source>/{{ sourcename|replace('.txt', '.rst') }}">Changelog</a></li>
</ul>
{% endblock %}
@OddBloke
OddBloke / gist:2360312
Created April 11, 2012 16:17
nose multiprocessing failure
from nose.tools import make_decorator
class decorate(object):
def __init__(self, numbers):
self.numbers = numbers
def __call__(self, f):
def wrap(args):
@OddBloke
OddBloke / preview_rest.py
Created November 3, 2011 20:34
PyBlosxom reST Preview
from pprint import pformat
import sys
from docutils.core import publish_parts
content = []
meta = {}
def _handle_line(line):
if not line.startswith('#'):