Skip to content

Instantly share code, notes, and snippets.

Mary is the proprietor of a bar in Dublin. She realises that virtually all of her customers are unemployed alcoholics and, as such, can no longer afford to patronise her bar. To solve this problem, she comes up with a new marketing plan that allows her customers to drink now, but pay later. She keeps track of the drinks consumed on a ledger (thereby granting the customers loans).
Word gets around about Mary's "drink now, pay later" marketing strategy and, as a result, increasing numbers of customers flood into Mary's bar. Soon she has the largest sales volume for any bar in Dublin.
By providing her customers freedom from immediate payment demands, Mary gets no resistance when, at regular intervals, she substantially increases her prices for wine and beer, the most consumed beverages. Consequently, Mary's gross sales volume increases massively. A young and dynamic vice-president at the local bank recognises that these customer debts constitute valuable future assets and increases Mary's borrowing limit. He
➜ vagrant-box vagrant ssh
/Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/virtualbox-0.7.3/lib/virtualbox/abstract_model/version_matcher.rb:9:in `assert_version_match': Required version: 3.2; Current: (VirtualBox::Exceptions::UnsupportedVersionException)
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/virtualbox-0.7.3/lib/virtualbox/abstract_model/relatable.rb:189:in `read_relationship'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/virtualbox-0.7.3/lib/virtualbox/abstract_model/relatable.rb:146:in `nat_driver'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/vagrant-0.4.1/lib/vagrant/ssh.rb:143:in `port'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/vagrant-0.4.1/lib/vagrant/ssh.rb:142:in `each'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/vagrant-0.4.1/lib/vagrant/ssh.rb:142:in `port'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/vagrant-0.4.1/lib/vagrant/ssh.rb:38:in `connect'
from /Users/dylanegan/.rvm/gems/ruby-1.8.7-p248/gems/vagrant-0.4.1/lib/vagrant/comma
gem = gem_package "gem" do
action :nothing
end
gem.run_action(:install)
Gem.clear_paths
require 'gem'
# shorthand
class NilClass
def id
rand(999999999)
end
end
rabbit_stew do |stew|
stew.fanout :bar, :queue => 'foo'
stew.direct :baz, :queue => 'wee'
stew.topic :wah do |topic|
topic.key "faz.*", :queue => 'wee'
end
queue :foo do
puts "im the foo queue. I handle the bar fanout for now."
end
>> yaml = StandardError.new("foo").to_yaml
=> "--- !ruby/exception:StandardError \nmessage: foo\n"
>> error = YAML.load(yaml)
=> #<StandardError: StandardError>
>> error.message
=> "StandardError"
>> error.to_yaml
=> "--- !ruby/exception:StandardError \nmessage: StandardError\nmesg: foo\n"
0 [Time 1250469127] [Message System SafeSleep
hibernate_page_list_setall start
hibernate_page_list_setall time: 171 ms
pages 471790, wire 124924, act 180813, inact 18, spec 6, zf 0, throt 1482, could discard act 44167 inact 27311 purgeable 18574 spec 74495
hibernate_page_list_setall found pageCount 307243
IOHibernatePollerOpen, ml_get_interrupts_enabled 0
IOHibernatePollerOpen(0)
writing 306047 pages
image1Size 166038016
all time: 11786 ms, comp time: 1871 ms, deco time: 0 ms,
- if @items
- @items.reject { |item| item[/views\/controls\/(hide-.*|index).haml/] }.each do |name|
%p do some stuff
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
workling = File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'workling', 'script', 'listen.rb')
options = {
:app_name => "workling",
:ARGV => ARGV,
:dir_mode => :normal,
:dir => File.join(File.dirname(__FILE__), '..', 'log'),
def f(ra,n)
r=0
ra.each {|x| r+=1 if x.include? n}
r
end