Skip to content

Instantly share code, notes, and snippets.

View alesdotio's full-sized avatar

Ales Kocjancic alesdotio

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alesdotio on github.
  • I am alesdotio (https://keybase.io/alesdotio) on keybase.
  • I have a public key whose fingerprint is 87FE 605F 5C52 1F3F 8463 2CF2 B771 384A 906F 27A1

To claim this, I am signing this object:

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
*.pyo
@alesdotio
alesdotio / gist:9760777
Last active August 29, 2015 13:57
Install PIL on OSX Mavericks
brew switch freetype 2.5.0.1
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install PIL==1.1.7 --allow-external PIL --allow-unverified PIL
@alesdotio
alesdotio / models.py
Created December 4, 2012 13:30
lazy translation getter
def lazy_translation_getter(self, name, default=None):
"""
Lazy translation getter that fetches translations from DB in case the instance is currently untranslated and
saves the translation instance in the translation cache
"""
stuff = self.safe_translation_getter(name, NoTranslation)
if stuff is not NoTranslation:
return stuff
@alesdotio
alesdotio / gist:4131603
Created November 22, 2012 15:03
AccessInit: hash collision: 3 for both 1 and 1
import sys
import PIL.Image
sys.modules['Image'] = PIL.Image
@alesdotio
alesdotio / osx_developer_installation.rst
Created September 29, 2012 13:48 — forked from FinalAngel/osx_developer_installation.rst
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

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

Homebrew

@alesdotio
alesdotio / gist:3619494
Created September 4, 2012 10:10
makemessages for all apps
for i in *; do cd $i; ../../bin/django makemessages -a; cd ..; done