Skip to content

Instantly share code, notes, and snippets.

@gabrielhurley
gabrielhurley / .pylintrc
Created September 4, 2011 02:34
PyLint config file that works reasonably well for linting Django files. Should be placed in ~/.pylintrc.
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@gabrielhurley
gabrielhurley / Horizon Architecture.rst
Created October 27, 2011 01:41
A proposal for a new long-term extensible architecture to meet the Horizon projects goals.

Horizon Architecture

Contents:

Values

@gabrielhurley
gabrielhurley / nonprofit_account.txt
Created October 27, 2011 23:15
Nonprofit Account Request For California Revels
Hi folks,
Following up from our thread on Twitter, here's another attempt at
providing you the necessary info:
I am the technical lead for the California Revels (a non-profit arts
and community theater organization which has been operating in
Oakland, CA for 25+ years) and we would love to use GitHub to manage
the codebase and issue tracking for our upcoming website redesign.
@gabrielhurley
gabrielhurley / modal.html
Created November 2, 2011 21:44
Quick bootstrap modal demo
<div id='new_comment' class='fade modal'>
<form class='form-stacked' action="{% comment_form_target %}" method="POST">{% csrf_token %}
<div class='modal-header'>
<a href="#" class="close">x</a>
<h3>Discuss Activity</h3>
</div>
<div class='modal-body'>
<p>Have a question? Need more information? Add a new comment to the discussion using the form below:</p>
{{ comment_form.as_custom }}
<input type='hidden' name='name' value='{{ profile }}'/>
@gabrielhurley
gabrielhurley / assignment_tag.py
Created November 9, 2011 06:46
Assignment tag backport
"""
Backports the ``register.assignment_tag`` functionality from Django 1.4 to
Django 1.3.
This code is almost entirely reproduced from
https://code.djangoproject.com/browser/django/trunk/django/template/base.py
and is the work of Django's authors:
https://code.djangoproject.com/browser/django/trunk/AUTHORS
It is licensed under Django's BSD license, available here:
@gabrielhurley
gabrielhurley / horizon_gerrit_setup.rst
Created November 9, 2011 20:01
Concise instructions for manually setting up gerrit review for OpenStack Dashboard (Horizon)

How to set up Gerrit and Git Review for OpenStack Dashboard (Horizon)

Step one:

cat <<EOF >>~/.gitconfig
[alias]
    review = !sh \`git rev-parse --show-toplevel\`/tools/rfc.sh
EOF
@gabrielhurley
gabrielhurley / utils.py
Created November 26, 2011 03:21
Django Convenience Utility Functions
# Copyright 2011 Gabriel Hurley <gabriel@strikeawe.com>
#
# Licensed under the OSI-approved Fair License:
#
# Usage of this work is permitted provided that this
# instrument is retained with the work, so that any
# entity that uses the work is notified of this instrument.
#
# DISCLAIMER: THIS WORK IS WITHOUT WARRANTY.
@gabrielhurley
gabrielhurley / data_table_api.py
Created November 28, 2011 22:59
Sample API for programmatic table generation
from horizon import api
from horizon.dashboards.nova.keypairs import forms as keypair_forms
from nebula_dashboard.utils import tables
def DeleteKeyPairs(tables.TableAction):
name = "delete"
def handle(self, data_table, request, object_ids):
@gabrielhurley
gabrielhurley / gerrit_review_process.rst
Created December 27, 2011 21:07
How to send changes to gerrit for review

How to send changes to gerrit for review

This is an opinionated step-by-step guide for how to not screw up working with Gerrit as a code review tool.

This presumes a setup where you're working on a forked copy of the repository and have created an "upstream" remote repository which points to the original.

@gabrielhurley
gabrielhurley / litany.rst
Created January 4, 2012 09:30
Litany, by Billy Collins

Litany, by Billy Collins

You are the bread and the knife, The crystal goblet and the wine...

-- Jacques Crickillon

: