Skip to content

Instantly share code, notes, and snippets.

🚀
Perf Testing all the Things!

Sebastian Cohnen tisba

🚀
Perf Testing all the Things!
Block or report user

Report or block tisba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CouchDB-changes-listener.rb
require "rubygems"
require "active_support/core_ext"
require "curb"
require "yajl"
class CouchDBChanges
def self.consume(database_url, opts={}, &block)
opts = {:feed => :continuous}.merge(opts)
View backend-rotation-for-riak-client.diff
diff --git a/riak-client/lib/riak/client.rb b/riak-client/lib/riak/client.rb
index 127c2c8..be94f75 100644
--- a/riak-client/lib/riak/client.rb
+++ b/riak-client/lib/riak/client.rb
@@ -35,6 +35,9 @@ module Riak
# @return [Fixnum] The port of the Riak HTTP endpoint
attr_reader :port
+ # @return [Array] of Riak HTTP endpoint hashes each consisting of :host and :port
+ attr_accessor :backends
View gist:489646
diff --git a/bin/pillow.tpl.in b/bin/pillow.tpl.in
index bc0bdfb..bfb9408 100755
--- a/bin/pillow.tpl.in
+++ b/bin/pillow.tpl.in
@@ -214,7 +214,7 @@ start_pillow () {
touch $PID_FILE
interactive_option="+Bd -noinput"
fi
- command="/usr/bin/erl -sname pillow $interactive_option -boot start_sasl +K true \
+ command="%ERL%/erl -sname pillow $interactive_option -boot start_sasl +K true \
View couchdb-installer-ubuntu.sh
#!/usr/bin/env bash
# where do you want couchdb and its deps to be installed
COUCHDB_PREFIX="/opt/couchdb-1.0.1"
# Let's determine the correct arcitecture and choose the installer
if [ "`uname -m`" = "x86_64" ]; then
echo "Using 64-bit installer"
COUCHDB_INSTALLER_DOC_ID="26f246a0fe23d6a53d5326713308f43c"
COUCHDB_INSTALLER_BIN="install-couchdb-1.0.1_rel1-linux-x64.bin"
View partials.rb
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)
View install_sun_java_jre_non-interactive.sh
#!/usr/bin/env bash
# add partner sources
echo -e "deb http://archive.canonical.com/ubuntu lucid partner \n\
deb-src http://archive.canonical.com/ubuntu lucid partner" >> /etc/apt/sources.list
# update package list
apt-get update
# read and accept the agreement
View using_build-couchdb_on_ubuntu.sh
#!/usr/bin/env bash
# Build CouchDB 1.0.1 from source using build-couchdb. All needed dependencies
# are also build from source and form a self-contained installation. Specifiy
# COUCHDB_PREFIX to the location where you would like to have everything
# installed to.
# When everything is done, the init.d-script and default settings for CouchDB
# are linked to the right places, the bind address is set to 0.0.0.0 and CouchDB
# will be started, so you can relax!
View api.feature
Scenario: Get List of My Hitchhiking Items via API
Given the existing things:
|name|
|The Guide (duh)|
|A towel|
|Sub-Etha Sens-O-Matic|
|Pan Galactic Gargle Blaster|
|Kill-o-Zap blaster pistol|
And the existing accounts:
|email|name|password|
View install_couchdb_ubuntu.sh
#!/usr/bin/env bash
# where do you want couchdb and its deps to be installed
COUCHDB_PREFIX="/opt/couchdb-1.0.1"
# Let's determine the correct arcitecture and choose the installer
if [ "`uname -m`" = "x86_64" ]; then
echo "Using 64-bit installer"
COUCHDB_INSTALLER_DOC_ID="26f246a0fe23d6a53d5326713308f43c"
COUCHDB_INSTALLER_BIN="install-couchdb-1.0.1_rel1-linux-x64.bin"
@tisba
tisba / gist:642163
Created Oct 23, 2010
Nested object decoding with json-gem
View gist:642163
require "rubygems"
# require "yajl/json_gem"
require "json"
class FooBarBase
attr_accessor :name, :type
def initialize(attributes = {})
attributes.each { |attr_name, attr_value| send("#{attr_name}=", attr_value) }
end
You can’t perform that action at this time.