Skip to content

Instantly share code, notes, and snippets.

Avatar

Rolo rolo

View GitHub Profile
@rolo
rolo / gist:1481128
Created Dec 15, 2011
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
View gist:1481128
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@rolo
rolo / html_compile.py
Created Aug 1, 2012
Python script to compile .shtml files with server side includes down to flat HTML suitable for hosting on S3 or where SSIs aren't supported.
View html_compile.py
#! /usr/bin/env python
import os
import re
import shutil
from os.path import splitext
SOURCE = os.getcwd() + "/www/"
TARGET = os.getcwd() + "/compiled/"
if not os.path.exists(TARGET):
@rolo
rolo / factories.py
Created Dec 7, 2012 — forked from mbrochh/factories.py
Django UserFactory with factory_boy - using random instead of clock to avoid username clashes
View factories.py
import random
from django.contrib.auth.models import User
from factory import Factory, LazyAttribute, Sequence
class UserFactory(Factory):
"""
Creates a new ``User`` object.
Username will be a random 30 character md5 value.
@rolo
rolo / republish_all_pages
Created Aug 8, 2013
Automatically republish all Django CMS 2.4.2 pages which are already published. For when all pages needed republishing after an upgrade from 2.3.x.
View republish_all_pages
from cms.models.pagemodel import Page
pages = Page.objects.filter(published=True, publisher_is_draft=True)
for page in pages:
print '%s (%d)' % (page, page.id)
page.publish()
View keybase.md

Keybase proof

I hereby claim:

  • I am rolo on github.
  • I am rolo (https://keybase.io/rolo) on keybase.
  • I have a public key whose fingerprint is 816E E5E2 8715 EF59 72F6 3B88 5579 CCA6 B686 4958

To claim this, I am signing this object:

You can’t perform that action at this time.