Skip to content

Instantly share code, notes, and snippets.

View NZKoz's full-sized avatar

Michael Koziarski NZKoz

View GitHub Profile
require 'thread'
class BuggeredLogger
def initialize
@buffer = []
@mutex = Mutex.new
end
def maybe_flush
flush if @buffer.size > 10
def Session::callback(dbman) #:nodoc:
Proc.new{
dbman[0].close unless dbman.empty?
}
end
def initialize(request, option={})
#blah blah
@dbprot = [@dbman]
ObjectSpace::define_finalizer(self, Session::callback(@dbprot))
end
class Customer
GREETING = "hello world!\n".freeze
def scale!
$stdout.write(GREETING)
end
end
a = Thread.new do
begin
require 'customer'
Customer.new.scale!
rescue e
p e
end
b = Thread.new do
begin
class Customer
GREETING = "hello world\n".freeze
sleep 5
def scale!
$stdout.write(GREETING)
end
end
class Customer
def Customer.create_and_scale!
new.scale!
end
#...
end
root@ip-10-251-107-50:~/rubygems-1.3.1# rdoc
The program 'rdoc' is currently not installed. You can install it by typing:
apt-get install rdoc
-bash: rdoc: command not found
root@ip-10-251-107-50:~/rubygems-1.3.1# apt-get install rdoc
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package rdoc
1837 1 1 11.6 MB 0.2 MB /usr/sbin/apache2 -k start
15881 1837 1 13.2 MB 1.6 MB /usr/sbin/apache2 -k start
15882 1837 1 13.2 MB 1.7 MB /usr/sbin/apache2 -k start
15883 1837 1 13.2 MB 1.7 MB /usr/sbin/apache2 -k start
15884 1837 1 13.2 MB 1.7 MB /usr/sbin/apache2 -k start
15885 1837 1 13.2 MB 1.7 MB /usr/sbin/apache2 -k start
15889 1837 1 12.9 MB 1.4 MB /usr/sbin/apache2 -k start
16090 1837 1 13.5 MB 1.9 MB /usr/sbin/apache2 -k start
# Title (100)
Introduction to Ruby on Rails
# Abstract (1500)
## Session Description:
Ruby on Rails is a web development framework designed to make web development fun again. Rails is a full-stack web development framework which contains everything you need to build modern applications. We optimised for programmer happiness and sustainable productivity. Web development is not meant to hurt, HTTP is not something to be abstracted away and javascript isn't an implementation detail.
This session will introduce the attendees to all the key pieces of Rails including:
Macintosh-5:~ michaelkoziarski$ textorize -f"Hoefler Text" -s30 "Hello mir.aculo.us readers"
<NSWindow: 0x101e43dc0>Macintosh-5:~ michaelkoziarski$