This article is now published on my website: Prefer Subshells for Context.
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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/zsh | |
# Copyleft 2010 paradoxxxzero All wrongs reserved | |
# With contribution from James Ahlborn | |
# https://gist.github.com/752727 | |
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ... | |
# From http://www.zsh.org/mla/users/2010/msg00692.html | |
# Token types styles. | |
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135 |
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 | |
echo "Purging pyc files and empty directories..." | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
# Delete .pyc files and empty directories. | |
find . -name "*.pyc" -delete 2>&1 > /dev/null & | |
find . -type d -empty -delete 2>&1 > /dev/null & |
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
attrcolor b ".I" | |
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' | |
defbce "on" |
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
!------------------------------------------------------------------------------- | |
! Xft settings | |
!------------------------------------------------------------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: false | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.hintstyle: hintslight |
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
Perlbrew — install multiple perl environments in $HOME | |
Bundle::Zoidberg — modular perl shell | |
Devel::REPL + Term::ReadLine::Perl + Term::ReadKey = handy REPL | |
Devel::Trace — print out each line before it is executed | |
use autodie | |
Module::UseFrom — use module from string | |
List::MoreUtils (List::AllUtils = List::Util + List::MoreUtils) | |
Params::Util - check parameter types properly (http://perladvent.org/2011/2011-12-23.html) | |
Try::Tiny — sugar for eval |
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
""" | |
Celery base task aimed at longish-running jobs that return a result. | |
``AwesomeResultTask`` adds thundering herd avoidance, result caching, progress | |
reporting, error fallback and JSON encoding of results. | |
""" | |
from __future__ import division | |
import logging | |
import simplejson |
OlderNewer