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 typing | |
__all__ = [ "Attribute", "AttributeMeta", "Spec", "undefaulted" ] | |
# sentinel | |
undefaulted = object() | |
class Attribute: | |
# support an optional type declaration which does nothing at present | |
def __init__(self, type_: typing.Any = None, default = undefaulted) -> None: |
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
'''Decorators to convert all arguments passed to a function or method to | |
unicode or str, including default arguments''' | |
import sys | |
import functools | |
import inspect | |
def _convert_arg(arg, from_, conv, enc): | |
'''Safely convert unicode to string or string to unicode''' | |
return getattr(arg, conv)(encoding=enc) if isinstance(arg, from_) else arg | |
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/sh | |
# git post-commit hook for pyflakes'ing modified files | |
git log --oneline --name-only | sed -n '2,$p' | while read f; do | |
if [ "${f%.py}" != "$f" -a -e "$f" ]; then | |
echo "$f" | |
elif file "$f" 2> /dev/null | grep python > /dev/null 2>&1; then | |
echo "$f" | |
fi | |
done | xargs pyflakes || echo "PYFLAKES FAILED, PLEASE INSPECT" |
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 fcntl | |
import time | |
import os | |
import sys | |
import shutil | |
import errno | |
import xapian as _x | |
# list of children to wait on | |
_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
import os | |
import signal | |
import sys | |
import select | |
import errno | |
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer | |
# BOOK-KEEPING | |
_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
syntax on | |
set viminfo='20,\"500 | |
set tabstop=4 shiftwidth=4 expandtab | |
set nohlsearch | |
set ignorecase smartcase | |
set number | |
autocmd FileType php set smartindent | |
autocmd FileType javascript set smartindent | |
autocmd FileType python set smartindent | |
autocmd FileType c set smartindent noexpandtab |
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
########################################################### | |
## .tmux.conf | |
## | |
## first pass at a .tmux.conf to make transition from | |
## gnu screen bearable | |
########################################################### | |
# screenesque prefix | |
set -g prefix C-a | |
bind C-a send-prefix |