This file contains 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' | |
=> true | |
>> require 'patron' | |
=> true | |
>> require 'json' | |
=> true | |
>> s = Patron::Session.new | |
=> #<Patron::Session:0x187a978> | |
>> s.base_url = 'http://twitter.com' | |
=> "http://twitter.com" |
This file contains 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
$LOAD_PATH.unshift File.dirname(__FILE__) | |
require 'rubygems' | |
require 'nokogiri' | |
require 'faster_builder/xml_markup' | |
require 'benchmark' | |
def nokogiri_builder | |
b = Nokogiri::XML::Builder.new do |xml| | |
xml.task do |
This file contains 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
commit 7fba8f5e4978b2ff990304f7150918f1cc0eea74 | |
Author: Aman Gupta <[email protected]> | |
Date: Fri Mar 27 13:51:30 2009 -0700 | |
dtrace patch for 1.8.7 (run autoconf, then ./configure --disable-pthread --enable-dtrace --prefix=/opt/ruby-dtrace) | |
diff --git a/Makefile.in b/Makefile.in | |
index a37bcf6..604bfed 100644 | |
--- a/Makefile.in | |
+++ b/Makefile.in |
This file contains 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 'eventmachine' | |
module ChatClient | |
def self.list | |
@list ||= [] | |
end | |
def post_init | |
@name = "anonymous_#{rand(99999)}" |
This file contains 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
# :PUBLISHER: markdown, shell, { command: 'rdiscount' } | |
# :BRACKET_CODE: '[ruby]', '[/ruby]' | |
# :TEXT: | |
# | |
# Have you ever started a long operation and walked away from the computer, and | |
# come back half an hour later only to find that the process is hung up waiting | |
# for some user input? It's a sub-optimal user experience, and in many cases it | |
# can be avoided by having the program choose a default if the user doesn't | |
# respond within a certain amount of time. One example of this UI technique in | |
# the wild is powering off your computer - most modern operating systems will |
This file contains 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
git branch --no-color | grep \* | awk '{print $2}' |
This file contains 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
$KCODE='u' | |
require 'jcode' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
IRB.conf[:SAVE_HISTORY] = 100 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
IRB.conf[:PROMPT_MODE] = :SIMPLE |
This file contains 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
$ irb | |
>> require 'rubygems' | |
=> true | |
>> require 'patron' | |
=> true | |
>> require 'json' | |
=> true | |
>> sess = Patron::Session.new | |
=> #<Patron::Session:0x682cd4> | |
>> sess.timeout = 30 |
This file contains 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
begin | |
require 'minigems' | |
rescue LoadError | |
require 'rubygems' | |
end | |
if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) || | |
File.directory?(gems_dir = File.join(File.dirname(__FILE__), '..', 'gems')) | |
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir) | |
end |
This file contains 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
begin | |
require 'minigems' | |
rescue LoadError | |
require 'rubygems' | |
end | |
if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) || | |
File.directory?(gems_dir = File.join(File.dirname(__FILE__), '..', 'gems')) | |
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir) | |
end |