This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install couchdb | |
# sudo easy_install pip | |
# pip install couchapp | |
# git clone https://github.com/codeforamerica/muralapp.git | |
# cd muralapp | |
# cp javascripts/settings.example.js javascripts/settings.js | |
# vi javascripts/settings.js | |
# cd couchapp | |
# couchapp push . http://localhost:5984/murals | |
# cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /mnt | |
curl -k -O https://raw.github.com/anotherjesse/vcap/auto/setup/install | |
chmod +x install | |
./install | |
ln -s /usr/local/rvm/bin/ruby /usr/local/bin/ | |
cd /cloudfoundry | |
bin/vcap start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django-openstack/django_openstack/auth/views.py b/django-openstack/django_openstack/auth/views.py | |
index 23e317f..51fec34 100644 | |
--- a/django-openstack/django_openstack/auth/views.py | |
+++ b/django-openstack/django_openstack/auth/views.py | |
@@ -37,6 +37,36 @@ class Login(forms.SelfHandlingForm): | |
messages.error(request, 'Error authenticating: %s' % e.message) | |
+class LoginWithTenant(forms.SelfHandlingForm): | |
+ username = forms.CharField(max_length="20", label="User Name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
$: << 'fog/lib' | |
require 'fog' | |
# Get your api key / token `keystone-mange token list` | |
compute = Fog::Compute.new(:provider => 'Rackspace', | |
:rackspace_auth_token => '887665443383838', | |
:rackspace_management_url => 'http://127.0.0.1:8774/v1.0/', | |
:rackspace_username => 'joeuser', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$HOME=File.expand_path(File.join(Dir.pwd, '..')) | |
Vagrant::Config.run do |config| | |
ip = "10.0.0.5" | |
aptdir = "#{$HOME}/aptcache/" | |
checkout = "#{$HOME}/openstack-cookbooks" | |
config.vm.box = "base" | |
config.vm.box_url = "http://images.ansolabs.com/vagrant/maverick64.box" | |
config.vm.network ip | |
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir) | |
config.vm.provision :chef_solo do |chef| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script runs all nova components in windows of a singe screen. | |
# Arguments: [nova.conf] [novarc] | |
function locate_binary { | |
# Called with the basename of a binary, like nova-api | |
# If we are in a nova checkout, use the bin/* version. | |
# Otherwise, get whatever is in ${PATH} for system wide nova | |
bin_name=${1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
# | |
# The goal for this exercise is to get the test to pass while not returning the | |
# expected value. | |
# | |
# CompTest may be renamed, as may CompEntry, so don't rely on names. | |
# | |
class CompEntry | |
def add addend_a, addend_b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
print "MESSAGE> " | |
message = gets.gsub(/\s/, '').split(//) | |
print "PAD> " | |
pad = gets.gsub(/\s/, '').split(//) | |
message.zip(pad) do |mc, pc| | |
puts "#{mc} | #{pc} | #{'%2i' % (nm = mc[0] - ?a)} | #{'%2i' % (np = pc[0] - ?a)} | #{'%2i' % ((nm + np) % 26)} | #{(((nm + np) % 26) + ?a).chr}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# examples of using before_render | |
# http://github.com/xtoddx/before_render | |
class HiController < ApplicationController | |
before_render :hook_it_up | |
before_render :double_hooked, :if => lambda{|x| false} | |
before_render :cool_action, :only => [:index] | |
before_render :lousy_action, :except => [:index] | |
# just the page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'rubygems' | |
gem 'twitter' | |
require 'twitter' | |
class AutoRetweet | |
def initialize search_phrase, config_file_name = 'config.yml' | |
@phrase = search_phrase | |
@config_file = config_file_name |