View BackboneMixin.react.js
function arrayRemove(array, item) {
var index = array.indexOf(item);
if (index !== -1) {
array.splice(index, 1);
function arrayPushUnique(array, item) {
if (array.indexOf(item) === -1) {
Outputs history with bash and git aliases expanded.
from __future__ import print_function
import re
from subprocess import check_output
for line in check_output('bash -i -c "alias -p"', shell=True).split('\n'):

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
# subtree merge with branches
rm -rf commcare-hq core-hq
git clone git://
git clone git://
cd core-hq
# git subtree merge one repo into another, copying all branches in the source
# repo to the destination repo, with the source repo's name added as a prefix
# to the branch name in the destination repo
# with handling of weird edge cases in subtree merge
# See for an overview of git subtree merge
View etc-init.d-touchforms
#! /bin/sh
# Provides: touchforms
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Initscript for touchforms server
# Description: Initscript for touchforms server
# This script installs dependencies for CommCare HQ on Ubuntu 12.04 (Java,
# Jython, couchdb, couchdb-lucene, less, uglifyjs, and various python packages)
# and sets couchdb and couchdb-lucene up to automatically run on startup. It
# also creates postgres (user 'django', pass 'django') and couchdb databases
# named according to $DBNAME as specified above.
# Before running, you must download the following files to the script's
# directory:
View foo.js
(function foo(x) {
return function bar() {
(function foo(x) {
return function bar() {
View CustomDbBehavior.php
* If you use different databases for development and production, it can be tedious to maintain
* propel configuration and database schema files in version control, because you need to change the
* database name and re-run propel-gen after pulling so the propel base objects refer to the correct
* database.
* This behavior allows you to specify a constant that will be defined when propel is loaded and
* which will be used as the database name in the generated Peer and Query classes instead of a