Skip to content

Instantly share code, notes, and snippets.

# execute command when file changed
#!/bin/bash
set -e
prev_cs=""; while true; do
cur_cs="`md5sum $*`"
if [ "$cur_cs" != "$prev_cs" ]; then
rake # change to your command
@dohsimpson
dohsimpson / learn-django.txt
Last active October 26, 2018 15:08
Learn Django
Django
Model:
Class Based Model:
* class MODEL(models.Model):
FIELD1 = models.AFIELD([FIELDNAME], [default=VALUE])
def __str__(self):
...
Fields:
@dohsimpson
dohsimpson / install-docker.sh
Last active August 29, 2015 14:23
Install docker and docker-compose on Ubuntu 14
#!/bin/bash
set -e
KERNEL_VERSION=`uname -r` # make sure kernel version >= 3.10
if [[ $KERNEL_VERSION != *"3.1"* ]]; then
echo "Kernel version must be >= 3.10"
fi
# for ubuntu 14: there's nothing required to install
# for ubuntu 12