Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
@kennethkalmer
kennethkalmer / gist:242210
Created November 24, 2009 20:58
Simple patron vs em-http-client observation
#
# Patron vs em-http-client
#
# This is not science, it is the same test suite on the same laptop running Ruby 1.9.1 on Leopard
# (ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]).
#
# Some insight into the matter might be found here: http://curl.haxx.se/mail/archive-2008-09/0075.html
#
class ModelWithIgnoredColumns < ActiveRecord::Base
class << self
def columns_without_binary_timestamps
columns = columns_with_binary_timestamps
columns.reject { |c| c.name == 'i_hate_you_microsoft' }
end
alias_method_chain :columns, :binary_timestamps
From 343e4e3955c095faf39f84dd7ddb0b0ea3b4380e Mon Sep 17 00:00:00 2001
From: Kenneth Kalmer <[email protected]>
Date: Tue, 1 Dec 2009 23:21:15 +0200
Subject: [PATCH] Don't halt the inheritence chain
---
lib/couchrest/more/extended_document.rb | 6 ++-
spec/couchrest/more/extended_doc_inherited_spec.rb | 40 ++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletions(-)
create mode 100644 spec/couchrest/more/extended_doc_inherited_spec.rb
require 'active_support'
# Define resources here
class Email < ActiveResourceBase
self.site = 'http://localhost:3000'
end
# Actual participant
class RailsParticipant
<?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"/>
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
# Mission, define relationships in a 'web fashion'
#
# {
# "links" : [
# { "rel" => "other_document", "href" => "1" },
# { "rel" => "other_document", "href" => "2" }
# ]
# }
#
@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');
@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'