Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
14:09 kennethkalmer: this search thing is tricky, and could a lot of issues if we don't manage it right
14:10 kennethkalmer: wondering if strictly OR isn't the best approach here
14:10 kennethkalmer: the client can also do some filtering
14:10 kennethkalmer: and the lookup requirements would be mostly client specific
14:10 kennethkalmer: (erm, project specific)
14:11 kennethkalmer: if any really advanced features are needed, the implementer can create their own storage participant and extend it to their liking
14:12 kennethkalmer: ruote-kit then expects the storage participants to implement certain methods, which are called for searching
14:12 kennethkalmer: the participant can then determine how to interpret the query and execute it according to it's own query plan
class AnnouncementsController < ApplicationController
def index
pagination_options = { :page => params[:page], :per_page => params[:per_page] }
@announcements = Announcement.by_admins( params[:archived], pagination_options )
end
end
From f3613550e7c25927f70dba1b6451b86fa67072c3 Mon Sep 17 00:00:00 2001
From: Kenneth Kalmer <[email protected]>
Date: Mon, 8 Feb 2010 09:59:55 +0200
Subject: [PATCH] Retrieve a list of participant names
---
lib/ruote/part/participant_list.rb | 6 ++++++
test/functional/ft_3_participant_registration.rb | 8 ++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
# racksh in ruote-kit project (Ruby 1.9.1)
ruby-1.9.1-p378 > RuoteKit.engine.context.plist.send :get_list
=> {"type"=>"configurations", "_id"=>"participant_list", "list"=>[["^.*$", ["Ruote::StorageParticipant", {}]]], "put_at"=>"2010/02/07 21:14:00.073761 UTC", "_rev"=>0}
ruby-1.9.1-p378 > RuoteKit.engine.register_participant :alpha do |wi|
ruby-1.9.1-p378 > puts "* alpha saw it"
ruby-1.9.1-p378 ?> end
ruby-1.9.1-p378 > RuoteKit.engine.context.plist.send :get_list
=> {"type"=>"configurations", "_id"=>"participant_list", "list"=>[["^.*$", ["Ruote::StorageParticipant", {}]], ["^alpha$", "inpa_:alpha"]], "put_at"=>"2010/02/08 07:55:41.237208 UTC", "_rev"=>1}
@kennethkalmer
kennethkalmer / gist:287612
Created January 27, 2010 07:00
Snow Leopard
kenneth@Kenneth-Kalmers-MacBook-Pro ~ $ gem sing treetop --backtrace -V
ERROR: While executing gem ... (NameError)
uninitialized constant DL::Importable
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/midiator-0.3.2/lib/midiator/drivers/dls_synth.rb:33:in `<module:AudioToolbox>'
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/midiator-0.3.2/lib/midiator/drivers/dls_synth.rb:32:in `<class:DLSSynth>'
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/midiator-0.3.2/lib/midiator/drivers/dls_synth.rb:28:in `<top (required)>'
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/midiator-0.3.2/lib/midiator/interface.rb:53:in `require'
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/midiator-0.3.2/lib/midiator/interface.rb:53:in `use'
/Users/kenneth/.rvm/gems/ruby/1.9.1/gems/rubygems-sing-1.1.0/lib/rubygems/commands/sing_command.rb:58:in `execute'
/Users/kenneth/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:257:in `invoke'
@kennethkalmer
kennethkalmer / gist:278814
Created January 16, 2010 13:14
node.js SMTP Server
/*
smtpd.js is SMTP server written for node.js
MIT License
*/
var tcp = require('tcp');
var sys = require('sys');
# Mission, define relationships in a 'web fashion'
#
# {
# "links" : [
# { "rel" => "other_document", "href" => "1" },
# { "rel" => "other_document", "href" => "2" }
# ]
# }
#
kenneth@Kenneth-Kalmers-MacBook-Pro ~ $ rvm update --self
rvm 0.0.90 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]
Updating installed gems
Updating rvm
Successfully installed rvm-0.0.91
Gems updated: rvm
-bash: cd: /Users/kenneth/.gem/ruby/1.8/gems/rvm-0.0.91: No such file or directory
<?xml version="1.0" encoding="UTF-8"?>
<process-definition revision="0.1" name="Test">
<!--
<cursor>
<participant ref="Anfang"/>
<participant ref="Mitte"/>
<if test="${field:reject} == true">
<back step="2"/>
</if>
<participant ref="Anfang"/>