Skip to content

Instantly share code, notes, and snippets.

@DangerDawson
DangerDawson / excon_bug.rb
Created December 23, 2010 17:12
A script which recreates the excon bug in ripple with key streaming
require 'ripple'
riak = Riak::Client.new( :http_backend => :Excon )
bucket_names = ["foobar"]
bucket_names.each do |bucket_name|
bucket = riak.bucket(bucket_name)
10.times do
new_one = Riak::RObject.new(bucket, "#{rand}")
new_one.content_type = "application/javascript" # You must set the content type.
@DangerDawson
DangerDawson / gist:46164ba54de58e8a697d2ecb9f36a02e
Created July 18, 2024 08:45
ROM relations optimisation 1
module ROM
class Finalize
class FinalizeRelations
include Dry::Core::Memoizable
# @return [Hash]
#
# @api private
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def run!
relation_registry = RelationRegistry.new do |registry, relations|
@DangerDawson
DangerDawson / gist:0eb82f7e61cc791a31af120427f128ac
Last active July 18, 2024 08:47
ROM relations optimisation 2
module ROM
class Finalize
class FinalizeRelations
attr_reader :notifications
module BuildRelationReaders
def self.build(relations)
Module.new do
relations.each do |name|
define_method(name) do