Skip to content

Instantly share code, notes, and snippets.

View philippeowagner's full-sized avatar

Philippe O. Wagner philippeowagner

View GitHub Profile
@philippeowagner
philippeowagner / config.ini
Last active August 29, 2015 14:04
Install the 3bot worker an your machine
[3bot-settings]
BOT_ENDPOINT=*
PORT = 55556
SECRET_KEY = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
#!/usr/bin/env python
from PIL import Image, ImageDraw
def main():
# Open the original image
main = Image.open("12voltm.jpg")
# Create a new image for the watermark with an alpha layer (RGBA)
# the same size as the original image
watermark = Image.new("RGBA", main.size)
@philippeowagner
philippeowagner / gist:8012a507774a015689da
Created September 25, 2014 21:36
Install pytz manually
cd $VIRTUAL_ENV/src
wget --no-check-certificate https://pypi.python.org/packages/source/p/pytz/pytz-2014.7.zip#md5=04a9558204119ce16af144e987b296e8
unzip pytz-2014.7.zip
cd pytz-2014.7/
python setup.py install
#!/usr/bin/env python
#
# Written in 2013. by Senko Rasic <senko.rasic@dobarkod.hr>
# This code is Public Domain. You may use it as you like.
__all__ = ['updated']
def updated(dct, *others):
@philippeowagner
philippeowagner / which.py
Last active August 29, 2015 14:07 — forked from senko/which.py
#!/usr/bin/env python
#
# A Python implementation of the handy `which' shell command, showing
# the full path to a command that's in your path.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Released to Public Domain. Use it as you like.
import sys
@philippeowagner
philippeowagner / gist:6cc0335d04decca353ca
Created October 15, 2014 07:58
Get version of Django
import django
django.get_version()

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

import zmq
import threading
import time
from random import choice
class ClientTask(threading.Thread):
"""ClientTask"""
def __init__(self):
threading.Thread.__init__ (self)
@philippeowagner
philippeowagner / gist:9edaca20354eaf5e181c
Created October 23, 2014 19:44
I just set up a Squeezbox Server on my Raspberry Pi
from functools import wraps
from django.conf import settings
from django.http import HttpResponseRedirect
def require_ssl(view):
"""
Decorator that requires an SSL connection. If the current connection is not SSL, we redirect to the SSL version of
the page.