Skip to content

Instantly share code, notes, and snippets.

@pricco
pricco / env_run.sh
Created August 20, 2012 03:34 — forked from mrowl/env_run.sh
Script for running sandboxed apps from outside the virtualenv environment. Useful when managing apps with supervisor.
#!/bin/bash
# Runs any command (the args) in the virtualenv environment where this script resides.
# You need to change the ACTIVATE_PATH variable
# depending on where your virtualenv activate file is relative to this script.
# The WORKING_DIR var controls the directory from which the command will be run.
# I put this in a bin folder at the top level of my app.
# my virtualenv structure:
# /my_env
# /my_env/bin ( with the venv activate script )
# /my_env/my_app
@pricco
pricco / fields.py
Created August 8, 2012 21:08
MultipleFileField & MultipleImageField <input type=file multiple=multiple>
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.utils.datastructures import MultiValueDict, MergeDict
from django.core import validators
from django.core.exceptions import ValidationError
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
@pricco
pricco / sequential.py
Created August 1, 2012 14:12
MongoKit: Auto Increment
from mongokit import Document
class Sequential(Document):
__collection__ = 'sequential'
structure = {
'_id': basestring,
'next': long
}
indexes = [{ 'fields': ['_id'], 'unique': True }]
@pricco
pricco / SVN_Git_Mirror.md
Created July 23, 2012 15:46 — forked from ticean/SVN_Git_Mirror.md
SVN Git Mirror

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References