The attached GraphViz dotfile is adapted from the Python documentation for collections.abc.
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 itertools | |
import functools | |
import fnmatch | |
import os | |
from StringIO import StringIO | |
import yaml | |
from yaml.parser import ParserError | |
import voluptuous as V |
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 | |
# An enhancement to the "python" executable that automatically launches you into the python debugger on error. | |
# | |
# Use it like you would the "python" executable, for example: | |
# $ trypy somefile.py | |
# or | |
# $ trypy somefile.py arg1 arg2 | |
# | |
# EXAMPLE: |
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
# bug.py | |
def decorate(func): | |
print('Decorating', func.__name__) | |
return func | |
def wrap_methods(cls): | |
for name in vars(cls): | |
if name.startswith('f_'): | |
setattr(cls, name, decorate(getattr(cls, name))) |
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
# Author: Chmouel Bodujnah <chmouel@chmouel.com> | |
# | |
# Pan a zsh tool to complete virtualenv tox targets and tests launched via | |
# testtools | |
# | |
# Demo: http://i.imgur.com/kJsJTjj.gif | |
# | |
# When you use zsh just source the file directly and when you are inside a | |
# project which has been pre-built with tox targets you can start do: | |
# pan <TAB> |
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
function check_for_virtual_env { | |
[ -d .git ] || git rev-parse --git-dir &> /dev/null | |
if [ $? == 0 ]; then | |
local ENV_NAME=`basename \`pwd\`` | |
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then | |
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME | |
fi | |
elif [ $CD_VIRTUAL_ENV ]; then |
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 sys | |
from gevent import server | |
from gevent.server import _tcp_listener # gevent.baseserver._tcp_listener -> gevent.server._tcp_listener ( gevent>0.13.6 ) | |
from gevent import pywsgi | |
from gevent.monkey import patch_all; patch_all() | |
from multiprocessing import Process, current_process, cpu_count | |
def hello_world(env, start_response): | |
if env['PATH_INFO'] == '/': | |
start_response('200 OK', [('Content-Type', 'text/html')]) |
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 Ultimate Hover Color Function | |
@author Gray Gilmore - http://code.graygilmore.com | |
The goal of this Sass function is provide a hover color that works | |
with any color on any background. No longer do we need to bundle | |
hover color options with our themes, let Sassy McSasserson take care | |
of that for you. | |
The hover color, seen in this demo as "After" text, must be visible in |
Have you ever wanted to have a Vagrant workspace with more than one Virtual Machine, and managed by Salt Stack? I did, but the documentation is not all there yet.
I managed to make it work with the following, hope it will be useful.
See the Complete salty-vagrant setup, but use the current Vagrantfile
to have two machines.
OlderNewer