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 | |
# Activating virtualenvs for use with supervisord example /etc/supervisord.conf: | |
# [program:PROJECT] | |
# command = /virtualenvs/virtualenv_cmd.sh /virtualenvs/VIRTUALENV python PROJECT/manage.py run_gunicorn -b | |
VIRTUAL_ENV=$1 | |
if [ -z $VIRTUAL_ENV ]; then | |
echo "usage: $0 </path/to/virtualenv> <cmds>" | |
exit 1 | |
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
brew install postgis20 | |
#now link it properly by getting the information for it | |
brew info postgresql92 | |
initdb /usr/local/var/postgres -E utf8 | |
# YOU MADE NEED TO: rm -rf /usr/local/var/postgres | |
export POSTGIS_SQL_PATH='/usr/local/Cellar/postgis20/2.0.4/share/postgis/' | |
# Creating the template spatial database. |
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
### MacOSX Postgres won't start | |
rm /usr/local/var/postgres/postmaster.pid | |
Users are getting "ImportError: No module named setuptools" when using pip to upgrade a package since distribute-0.7.3 was released. | |
e.g. when running a command like this: pip install --upgrade pyramid | |
Solution |
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
.video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; } | |
.video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; } | |
.video:after { content: ""; position: absolute; display: block; | |
background: url(play-button.png) no-repeat 0 0; | |
top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; } | |
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } | |
/* image poster clicked, player class added using js */ | |
.video.player img { display: none; } | |
.video.player:after { display: none; } |
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
pip install ipython sphinx pyzmq pygments tornado nose django-extensions | |
easy_install readline pyzmq | |
# Now can run with django | |
# ./manage.py shell_plus --notebook |
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 PIL import Image, ExifTags | |
photo = Image.open(args['filename']) | |
photo_exif = None | |
try: | |
# See if this image has any exif | |
photo_exif = Image.open(args['filename'])._getexif() | |
except: | |
pass | |
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.forms import widgets | |
from datapoint.models import Datapoint, Annotation | |
from rest_framework import serializers | |
from rest_framework.exceptions import ParseError | |
from tags.serializers import TagSerializer | |
from tags.models import Tag | |
from users.serializers import UserSerializer | |
import simplejson as json | |
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
class Annotation(models.Model): | |
datapoint = models.ForeignKey('datapoint.Datapoint', related_name='%(class)s_parent_datapoint_relation') | |
owner = models.ForeignKey('users.User', related_name='%(class)s_creator_relation') | |
tags = models.ManyToManyField('tags.Tag', related_name="%(class)s_tags_relation", blank=True) | |
# Key fields from the Annotator JSON Format: http://docs.annotatorjs.org/en/latest/annotation-format.html | |
annotator_schema_version = models.CharField(max_length=8, blank=True) | |
text = models.TextField(blank=True) | |
quote = models.TextField() |
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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
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
*PPD-Adobe: "4.3" | |
*%%%% PPD file for ZPL Label Printer with CUPS. | |
*%%%% Created by the CUPS PPD Compiler CUPS v2.1.3. | |
*% Copyright 2007-2014 by Apple Inc. | |
*% Copyright 1997-2007 by Easy Software Products. | |
*% | |
*% These coded instructions, statements, and computer programs are the | |
*% property of Apple Inc. and are protected by Federal copyright | |
*% law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
*% which should have been included with this file. If this file is |
OlderNewer