Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
diff --git a/lib/ruote-amqp/participant.rb b/lib/ruote-amqp/participant.rb
index f6aa9c2..25bf604 100644
--- a/lib/ruote-amqp/participant.rb
+++ b/lib/ruote-amqp/participant.rb
@@ -120,8 +120,6 @@ module RuoteAMQP
#
def initialize(options)
- RuoteAMQP.start!
-
#--
# Copyright (c) 2005-2011, John Mettraux, [email protected]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@kennethkalmer
kennethkalmer / smtp-sink.rb
Created February 9, 2011 10:03
Simple SMTP sink for eventmachine
require 'rubygems'
require 'eventmachine'
class SmtpSink < EM::Protocols::SmtpServer
def receive_data_chunk( data )
buffer.concat data
end
def receive_message
puts
@kennethkalmer
kennethkalmer / README
Created October 28, 2010 11:26
Sample mysql_grant provider for Chef
Prototype mysql_grant provider for Chef
---------------------------------------
Drop the two files into your mysql cookbook, and experiment with the following examples:
mysql_grant "kenneth" do
action :grant
username "root" # <- User with admin privs
password node[:mysql][:server_root_password]
# Actual grant details
Ruote.process_defition :name => 'Hello world' do
cursor :break_if => "${f:error}" do
foo :command => '/verify/something'
bar :command => '/report'
end
end
diff --git a/lib/ruote-kit/application.rb b/lib/ruote-kit/application.rb
index 426759f..7a206eb 100644
--- a/lib/ruote-kit/application.rb
+++ b/lib/ruote-kit/application.rb
@@ -1,10 +1,9 @@
require 'sinatra/respond_to'
require 'haml'
-Sinatra::Application.register Sinatra::RespondTo
-
@kennethkalmer
kennethkalmer / smtp-sink.rb
Created July 23, 2010 12:15
Very simple SMTP sinkhole that just prints the messages to stdout
require 'rubygems'
require 'eventmachine'
class SmtpSink < EM::Protocols::SmtpServer
def receive_data_chunk( data )
buffer.concat data
end
def receive_message
puts
@kennethkalmer
kennethkalmer / Bench.class.php
Created July 20, 2010 10:45
Hopefully my last PHP script ever
/**
* Useful to time buggy stupid ugly PHP crap
*
* $bench = new Bench;
* $bench->output('Starting');
* stupid_slow_function();
* $bench->output('Done');
*
*
* Can be called several times on an instance, inserts HTML comments like this:
mysql> SHOW ENGINE INNODB STATUS\G
*************************** 1. row ***************************
Status:
=====================================
100316 11:24:35 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 8 seconds
----------
BACKGROUND THREAD
----------
kenneth@Kenneth-Kalmers-MacBook-Pro ~/Code/FOSS/ruote/ruote-kit (errors) $ spec -O spec/spec.opts spec/resources/errors_spec.rb
**************
Pending:
GET /_ruote/errors without any errors should report no errors (HTML) (Not Yet Implemented)
/Users/kenneth/Code/FOSS/ruote/ruote-kit/spec/resources/errors_spec.rb:7:in `block (2 levels) in <top (required)>'
GET /_ruote/errors without any errors should report no errors (JSON) (Not Yet Implemented)
/Users/kenneth/Code/FOSS/ruote/ruote-kit/spec/resources/errors_spec.rb:8:in `block (2 levels) in <top (required)>'