This file contains hidden or 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
~ > cat /usr/local/bin/git-publish | |
#!/usr/bin/env ruby | |
cmds = [] | |
cmds << "git co gh-pages" | |
cmds << "git merge master" | |
cmds << "git push github gh-pages" | |
cmds << "git co master" | |
system cmds.join("&&") |
This file contains hidden or 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 | |
vfile=$1 | |
for line in `cat ${vfile}`; do | |
gem=${line%%=*} | |
version=${line##*=} | |
if gem list | grep ${gem} | grep "(${version})"; then | |
echo "${gem} (${version}) is already installed" | |
else | |
gem install ${gem} -v ${version} --no-rdoc --no-ri | |
fi |
This file contains hidden or 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 | |
# Close stdin | |
exec <&- | |
devices=$(ls /dev/sd? | grep -v '/dev/sda') | |
devcount=$(echo "$devices" | wc -w) | |
FSTYPE=ext4 |
This file contains hidden or 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
from time import time | |
import math | |
class AccrualFailureDetector(object): | |
""" Python implementation of 'The Phi Accrual Failure Detector' | |
by Hayashibara et al """ | |
max_sample_size = 1000 | |
threshold = 3 # 1 = 10% error rate, 2 = 1%, 3 = 0.1%, etc |
This file contains hidden or 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 ReverseProxied(object): | |
def __init__(self, app): | |
self.app = app | |
def __call__(self, environ, start_response): | |
script_name = environ.get('HTTP_X_SCRIPT_NAME', None) | |
if script_name is not None: | |
environ['SCRIPT_NAME'] = script_name | |
path_info = environ['PATH_INFO'] | |
if path_info.startswith(script_name): |
This file contains hidden or 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 | |
# Usage: bash < <(curl -s https://gist.github.com/raw/965142/install.sh) | |
if [ ! -d "/Developer/Applications/Xcode.app" ]; then | |
echo "Please install Xcode first. Exiting." | |
exit 1 | |
fi | |
# Have sudo ask us for our password before we kick everything off so we can walk away. | |
sudo echo "Here we go..." |
This file contains hidden or 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
Track A | |
Bytes and Blobs – David Flanagan @__DavidFlanagan | |
Slides: http://davidflanagan.com/Talks/jsconf11/BytesAndBlobs.html | |
Conference Wifi Redux - Malte Ubi @cramforce | |
Sashimi: https://github.com/cramforce/Sashimi | |
Slides: http://social-traffic.streamie.org/preso/static/#slide1 | |
Run Your JS everywhere with Jellyfish – Adam Christian @admc |
This file contains hidden or 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
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery | |
set nocompatible | |
set autoindent | |
set tabstop=2 | |
set showmatch | |
set vb t_vb= | |
set ruler | |
set nohls | |
set incsearch | |
syntax on |
This file contains hidden or 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
""" | |
Patches the database wrapper and template engine to throw an exception if a query is executed inside of a template. | |
In your urls.py, enable it like so: | |
>>> import monkey | |
>>> monkey.patch_templates() | |
""" | |
import logging |
This file contains hidden or 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 | |
# Because Puppet has supported "solo" mode since 2005 | |
exec puppet $@ |