Skip to content

Instantly share code, notes, and snippets.

source :rubygems
gem 'activerecord', '3.1.0', :require => "active_record"
gem 'haml'
gem 'padrino', '0.10.5'
gem 'pg'
gem 'rake'
gem 'redis'
gem 'ruote', "~> 2.3.0", :require => "ruote"
@netinlet
netinlet / json_decode_error.rb
Created March 26, 2012 21:39
json decode error
# THE SQL for the Case object is above the Case Object
# To generate error
# to run: bundle exec ruby json_decode_error.rb
# http://localhost:4567/start
# Copy the WFID which is printed
# http://localhost:4567/history/:wfid
require 'rubygems'
require 'ruote'
@netinlet
netinlet / gist:2207156
Created March 26, 2012 17:36
ruote history
module Ruote
class StorageHistory
def steps_by_process(wfid)
# which ones were 'executed' - filters out items like setting up sequence and concurrence steps
all_expressions = self.by_process(wfid)
dispatched_expressions = all_expressions.select{|flow_expr| 'dispatched' == flow_expr["action"]}
# for all the flow_expressions, get the name and order by sorting by the original timestamp
dispatched_expressions.map do |flow_expr|
[flow_expr['participant_name'], flow_expr["original_put_at"]]
end.sort{|a,b| a.last <=> b.last}.map{|exp| exp.first}
@netinlet
netinlet / gist:2159172
Created March 22, 2012 15:57
Ruote Concurrence
require 'rubygems'
begin
require 'yajl'
rescue LoadError => le
require 'json'
end
require 'ruote'
require 'ruote/storage/fs_storage'
Getting up and running with OS X, Textmate & Scheme
===================================================
SCHEME
======
I ran across two implementations of Scheme which appear to work well with OS X.
mit-scheme & PLT Scheme.
I was able to install mit-scheme from darwin ports ( sudo port install mit-scheme)
@netinlet
netinlet / smtp_tls.rb
Created March 22, 2009 00:26
SMTP Extension to allow ActionMailer to use Google Mail SMTP
#
# SMTP Extension to allow ActionMailer to use Google Mail SMTP
#
# http://godbit.com/forum/viewtopic.php?id=876
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private