Skip to content

Instantly share code, notes, and snippets.

View emperorcezar's full-sized avatar

Adam "Cezar" Jenkins emperorcezar

  • SpotHero
  • Mokena, IL
View GitHub Profile
@glarrain
glarrain / model_mixins.py
Created April 23, 2013 23:18
Django model mixin to force Django to validate (i.e. call `full_clean`) before `save`
class ValidateModelMixin(object):
"""Make :meth:`save` call :meth:`full_clean`.
.. warning:
This should be the left-most mixin/super-class of a model.
Do you think Django models ``save`` method will validate all fields
(i.e. call ``full_clean``) before saving or any time at all? Wrong!
@specialkevin
specialkevin / gist:3092427
Created July 11, 2012 19:05
VagrantFile Template
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "http://example.com"
chef.validation_key_path = "~/.chef/validation.pem"
chef.node_name = "example"
chef.add_role("example")
@iiie
iiie / notku
Created June 24, 2012 09:46
Get env in virtualenv...
#!/usr/bin/env python
# Author: iiie
# Need: Get environment variables into virtualenv / Django
# Usage:
# Add one or more keys:
# notku config:add AWS_KEY=abc123 [ANOTHER_KEY=another_value=allowed ...]
# Removed one or more keys:
# notku config:remove AWS_KEY [ANOTHER_KEY ...]
# List all keys
# notku config