Skip to content

Instantly share code, notes, and snippets.

window.addEvent 'domready', ->
$$('[toggle_id]').each(hookupIDToggler)
hookupIDToggler = (element) ->
respondToClickOrChange element
initialToggleIfChecked element
respondToClickOrChange = (element) ->
%% When the port is set to 9000:
[
{riak_kv, [
{js_max_vm_mem, 8},
{storage_backend, riak_kv_test_backend},
{js_thread_stack, 16},
{riak_kv_stat, true},
{pb_ip, "127.0.0.1"},
development:
port: 8091
host: localhost
test:
port: 8098
host: localhost
bin_dir: /Users/duff/code/riak/rel/riak/bin
js_source_dir: <%= Rails.root + "lib/riak_js" %>
production:
port: 8091
Rspec.configure do |config|
config.mock_with :mocha
config.filter_run :focused => true
config.alias_example_to :fit, :focused => true
config.after(:each) do
$test_server.recycle if $test_server
end
end
# config/ripple.yml
development:
port: 8091
host: localhost
test:
port: 8098
host: localhost
class It
include Ripple::Document
property :email, String
end
# Using Sean's work on some built-ins: https://gist.github.com/63d3b5edd2ec011532ea
class Account
include Ripple::Document
property :charged_for_storage_at, Time
end
mr = Riak::MapReduce.new(Ripple.client).
add("accounts").
# An account has payment methods. I'd like to know the payment methods for an account
# which meet some criteria.
# The 2 models
class Account
include Ripple::Document
many :payment_methods
end
In your editor of choice,
Convert the following line:
context "when the transaction is successful", :focused => true do
To:
context "when the transaction is successful" do
@duff
duff / config-initializers-ripple.rb
Created June 17, 2010 19:49
Temporary hack to whack the Riak database between cuke runs.
module Ripple
module Document
def self.included(mod)
all << mod
end
def self.all
@document_models ||= []
end
end