Skip to content

Instantly share code, notes, and snippets.

View blorenz's full-sized avatar

Brandon Lorenz blorenz

View GitHub Profile
.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; }
@blorenz
blorenz / Common Messups
Last active December 21, 2015 15:08
Common messups and solutions
### 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
@blorenz
blorenz / GeoDjango PostGIS
Last active December 21, 2015 08:08
Create a PostGIS database
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.
@blorenz
blorenz / virtualenv_cmd.sh
Last active December 21, 2015 06:29
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 127.0.0.1:9920 -t 1200
#!/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