Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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

:

@gabrielhurley
gabrielhurley / response_example.py
Created January 10, 2012 02:31
Example for cleaner multi-object response messages.
class DeleteGroup(tables.Action):
name = "delete"
verbose_name = _("Delete")
verbose_name_plural = _("Delete Security Groups")
classes = ('danger',)
def allowed(self, request, security_group=None):
if not security_group:
return True
return security_group.name != 'default'
@gabrielhurley
gabrielhurley / keystone_api_test.py
Created January 26, 2012 23:32
This tests itself.
def test_tenant_create(self):
kwargs = {'id': TEST_TENANT_ID,
'description': 'aDescription',
"enabled": True}
tenant = keystoneclient_tenants.Tenant(self.request, kwargs)
keystoneclient = self.stub_keystoneclient()
keystoneclient.tenants = self.mox.CreateMockAnything()
keystoneclient.tenants.create(*kwargs.values()).AndReturn(tenant)
self.mox.ReplayAll()
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of the document</title>
</head>
<body>
<table>
<thead>
<tr>