Skip to content

Instantly share code, notes, and snippets.

@eltismerino
eltismerino / gist:a8ec8584034c8a7d087e
Last active January 22, 2016 10:57 — forked from mgedmin/gist:f832eed2ac0f3ce31edf
This actually works and unlike the older version doesn't mess up the task aliases parameter
from functools import wraps
from fabric import tasks
def fix_boolean(f):
true_values = ("yes", "true", "1")
false_values = ("no", "false", "0")
def fix_bool(value):
if isinstance(value, basestring):
@eltismerino
eltismerino / nginx.conf
Last active August 29, 2015 14:26 — forked from spikegrobstein/nginx.conf
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
@eltismerino
eltismerino / gist:3ddcf44f6621869b629a
Created November 7, 2014 02:33
Simple universal installshield extraction batch
@echo off
set OUTDIR=%~d1%~p1%~n1
set FILE=%~nx1
set EXT=%~x1
echo InstallShield Extractor (inspired by http://stackoverflow.com/questions/8681252/programmatically-extract-contents-of-installshield-setup-exe)
echo Current Directory is %cd%
echo %EXT%
if "%EXT%"==".msi" ( goto :msi )
if not "%EXT%"==".exe" ( goto :unsupported )
@eltismerino
eltismerino / gist:3cd41685c25c0c6e0dfd
Created September 4, 2014 10:41
Decorator for adding linked fields to admin
from django.core.urlresolvers import reverse
from django.core.exceptions import MultipleObjectsReturned
from django.utils.safestring import mark_safe
def add_link_field(target_model=None, field='', app='', field_name='link',
link_text=unicode, short_description=None):
"""
decorator that automatically links to a model instance in the admin;
inspired by http://stackoverflow.com/questions/9919780/how-do-i-add-a-link-from-the-django-admin-page-of-one-object-
to-the-admin-page-o