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 | |
# | |
# This is an example of using HGEDITOR to create of diff to review the | |
# changes while commiting. | |
# If you want to pass your favourite editor some other parameters | |
# only for Mercurial, modify this: | |
case "${EDITOR}" in | |
"") | |
EDITOR="vi" |
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
In [1]: %psource Tiger | |
class Tiger(models.Model): | |
call = models.CharField(max_length=255, blank=True) | |
In [2]: tony = Tiger() | |
In [3]: tony.call = u'Grrrreeeeeeeeaaaaaatttt' | |
In [4]: tony.save() |
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
def migrate(): | |
"""apply all pending db migrations""" | |
django_admin('migrate') | |
def django_admin(arguments): | |
require('target', provided_by=['stage', 'live']) | |
settings = '%(project)s.configs.%(target)s.settings' % env | |
cmd = '%(venv)s/bin/dj |
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 | |
# subshell for `set -e` and `trap` | |
( | |
set -e # fail immediately if there's a problem | |
# use `git-up` if installed | |
# if type git-up > /dev/null 2>&1 | |
# then | |
# exec git-up | |
# fi |
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
@require_POST | |
def receive(request): | |
try: | |
fname = request.GET['qqfile'] | |
except KeyError: | |
return HttpResponseBadRequest(json.dumps({ | |
'success': 'Miss |
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
git log --format=%H --follow -- "$@" | xargs --no-run-if-empty git show --stat |
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 | |
function git_current_tracking | |
{ | |
local BRANCH="$(git describe --contains --all HEAD)" | |
local REMOTE="$(git config branch.$BRANCH.remote)" | |
local MERGE="$(git config branch.$BRANCH.merge)" | |
if [ -n "$REMOTE" -a -n "$MERGE" ] | |
then | |
echo "$REMOTE/$(echo "$MERGE" | sed 's#^refs/heads/##')" | |
else |
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 | |
set -o errexit | |
CURRENT_BRANCH=`git branch | grep '\*' | awk '{print $2}'` | |
[[ -n `git config gitflow.branch.develop` ]] && DEVELOPMENT_BRANCH=`git config gitflow.branch.develop` | |
if [ -z ${DEVELOPMENT_BRANCH} ] | |
then | |
[[ -n `git branch | grep master` ]] && DEVELOPMENT_BRANCH=master | |
fi |
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
sudo('chown www-data:www-data ' | |
'%(path)s/releases/%(release_name)s/ebay/assets/ -R' % env) | |
cmd = 'chown www-data: -R' | |
path = '%(path)s/releases/%(release_name)s/ebay/assets' % env) | |
sudo('%s %s' % (cmd, path) |
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 boto | |
import sys | |
def dns_entries(zone_name): |
OlderNewer