Skip to content

Instantly share code, notes, and snippets.

View danrjohnson's full-sized avatar

Dan Johnson danrjohnson

  • Sprout Social
  • Chicago
View GitHub Profile
  • Update HISTORY.rst
  • Update version number in my_project/__init__.py
  • Update version number in setup.py
  • Install the package again for local development, but with the new version number:
python setup.py develop
  • Run the tests:
python setup.py test
@kcd83
kcd83 / encrypt_data_bag.rb
Created August 14, 2013 03:29
Standalone script for encrypting a json file data bag into an encrypted data bag for opscode chef .
#!/usr/bin/env ruby
if ARGV.length < 2
puts "usage: #{$0} databag.json new_encrypted_databag.json [encrypted_data_bag_secret]"
exit(1)
end
databag_file = ARGV[0]
out_file = ARGV[1]
if ARGV.length >= 3
@kvnn
kvnn / DJANGO_get_next_or_prev
Created April 4, 2012 16:33
Django: Get next or previous item of a Queryset
''' Useage ''''
# Declare our item
store = Store.objects.get(pk=pk)
# Define our models
stores = Store.objects.all()
# Ask for the next item
new_store = get_next_or_prev(stores, store, 'next')
# If there is a next item
if new_store:
# Replace our item with the next one
@BenHall
BenHall / bootstrap.jade
Created November 22, 2011 18:36
Twitter Bootstrap in Jade
script(src='/javascripts/jquery-1.7.min.js')
link(rel='stylesheet', href='/stylesheets/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-overrides.css')