This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'cassandra/0.7' | |
require 'lib/cassandra_lock' | |
require 'fileutils' | |
WORKER_COUNT = 10 | |
#WORKER_COUNT = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A ruote demo for | |
# http://www.quora.com/Which-workflow-management-system-does-the-following | |
require 'rubygems' | |
require 'fileutils' | |
require 'ruote' # gem install ruote | |
require 'ruote/storage/fs_storage' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# a Perl/Ack mini-clone in Ruby | |
# | |
# Copyright (c) 2008-2010, John Mettraux, [email protected] | |
# | |
# Made in Japan | |
# | |
# License is the MIT one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmettraux@sanma ~ 〒 cd tmp | |
jmettraux@sanma ~/tmp 〒 mkdir tuna | |
jmettraux@sanma ~/tmp 〒 cd tuna | |
jmettraux@sanma ~/tmp/tuna 〒 rvm use 1.9.2 | |
info: Using ruby 1.9.2 p0 | |
jmettraux@sanma ~/tmp/tuna 〒 rvm gemset create tuna | |
info: Gemset 'tuna' created. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License is MIT | |
require 'rubygems' | |
require 'json' # sudo gem install json | |
require 'open-uri' | |
require 'yaml' | |
u = ARGV[0] || raise("usage : ruby tff.rb {username}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'sinatra', '1.1.0' | |
gem 'sinatra-respond_to', '0.5.0' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'yajl-ruby', :require => 'yajl' | |
#gem 'ruote', '2.1.8' | |
gem 'ruote' | |
#gem 'ruote', :git => 'http://github.com/jmettraux/ruote.git', :branch => 'ruote2.1' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'patron' | |
pat = Patron::Session.new | |
pat.base_url = '127.0.0.1:4567' | |
data = File.read('tweet.png') | |
pat.put('/', data, 'Content-Type' => 'image/png') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rufus-scheduler' | |
class CronScheduler | |
def initialize (opts={}) | |
@frequency = opts[:frequency] || 0.3 | |
@jobs = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
require "rubygems" | |
require "ffi" | |
# map the C interface | |
module Lib | |
extend FFI::Library | |
ffi_lib( | |
*Array( |