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
#! /usr/bin/env python | |
""" | |
A script for increasing the version in an npm project's | |
package.json. | |
""" | |
import argparse | |
import json | |
import sys |
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
from django.shortcuts import render_to_response | |
def with_template(template): | |
""" | |
A decorator to render the view with a template. The view just | |
returns a contect dictionary. eg: | |
@with_template('index.html') | |
def index_view(request): |
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
find . -exec rm -rf {} \; || true | |
git clone git@github.com:${GITHUB_USERNAME}/${GITHUB_PROJECT}.git . | |
git checkout ${GIT_BRANCH} | |
docker-machine rm ${GITHUB_PROJECT}-${GIT_BRANCH} || true # while testing | |
docker-machine create ${GITHUB_PROJECT}-${GIT_BRANCH} --driver digitalocean --digitalocean-access-token TOKEN | |
eval "$(docker-machine env ${GITHUB_PROJECT}-${GIT_BRANCH})" | |
docker-compose -f docker-compose-machine.yml up -d |
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
0.0.0.0:2020 | |
gzip | |
log access.log | |
git git@github.com:0atman/0atman.com.git git { | |
interval 5 | |
then make 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
#!/usr/bin/env python | |
# | |
# sixty.py, a (10+2)x5 implimentation. | |
# http://www.43folders.com/2005/10/11/procrastination-hack-1025 | |
# | |
# Copyright 2009 Tristram Oaten | |
# This program is distributed under the | |
# terms of the GNU General Public License | |
# see <http://www.gnu.org/licenses/> |
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 | |
# | |
# An example hook script that is called after a successful | |
# commit is made. | |
# | |
# To enable this hook, make this file executable. | |
echo "Starting auto-deploy..." | |
cd /usr/share/django |
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
clean: | |
find ./ -name '*~' -exec rm -f {} \; | |
find ./ -name '#*' -exec rm -f {} \; | |
find ./ -name 'Thumbs.db' -exec rm -f {} \; | |
find ./ -name '*.pyc' -exec rm -f {} \; |
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
Section "InputClass" | |
Identifier "Trackpoint Wheel Emulation" | |
MatchProduct "PS/2 Generic Mouse" | |
MatchDevicePath "/dev/input/event*" | |
Option "EmulateWheel" "true" | |
Option "EmulateWheelButton" "2" | |
Option "EmulateWheelTimeout" "200" | |
Option "YAxisMapping" "4 5" | |
Option "XAxisMapping" "6 7" | |
EndSection |
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
""" | |
Python features bingo. | |
I hope you enjoy reading this as much as I enjoyed writing it! | |
""" | |
import json | |
def tracks_to_json_playlist(tracks, playlist=None): | |
''' | |
Takes a queryset of tracks and returns a json playlist | |
''' |
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
while inotifywait -r -q -q -e close_write *; | |
do ./manage.py test -v0 --failfast; | |
done |