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
# find two words that share the same pluralization for tpope. :D | |
# Steven Soroka | |
# http://blog.stevensoroka.ca | |
require 'ansi' # sudo gem install ssoroka-ansi | |
# load words with an array of words. | |
# words = IO.read("/usr/share/dict/words").split("\n").uniq # or something, | |
# then take out a crap load or it'll take till christmas 2053 | |
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
class RouteFilter | |
class << self | |
def routes | |
ActionController::Routing::Routes.routes | |
end | |
def controllers | |
::Object.subclasses_of( ::ActionController::Base ) |
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
# install latest cucumber as gem. | |
git clone git://github.com/aslakhellesoy/cucumber.git | |
cd cucumber | |
git checkout v0.1.99.21 | |
rake gem | |
sudo gem install pkg/cucumber-0.1.99.21.gem | |
cd .. | |
rm -rf cucumber |
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
1939 David Heinemeier Hansson | |
1668 Jeremy Kemper | |
444 Josh Peek | |
436 Rick Olson | |
354 Jamis Buck | |
339 Nicholas Seckar | |
302 Michael Koziarski | |
268 Pratik Naik | |
156 Marcel Molina Jr. | |
148 Geoff Buesing |
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
have_library: checking for GeoIP_new() in -lGeoIP... -------------------- no | |
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -arch ppc -arch i386 -Os -pipe -fno-common conftest.c -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch ppc -arch i386 -lruby -lGeoIP -lpthread -ldl -lm " | |
conftest.c: In function ‘t’: | |
conftest.c:3: error: ‘GeoIP_new’ undeclared (first use in this function) | |
conftest.c:3: error: (Each undeclared identifier is reported only once | |
conftest.c:3: error: for each function it appears in.) | |
conftest.c: In function ‘t’: | |
conftest.c:3: error: ‘GeoIP_new’ undeclared (first use in this function) | |
conftest.c:3: error: (Each undeclared identifier is reported only once |
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
######### bin/task_runner.rb ########## | |
# USAGE: | |
# | |
# ruby task_runner.rb run -- start the daemon and stay on top | |
# ruby task_runner.rb start -- start the daemon and stay on top | |
# ruby task_runner.rb stop stop all instances of the application | |
# ruby task_runner.rb restart stop all instances and restart them afterwards | |
require 'rubygems' |
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
# renders public/400.html on requests that do not supply expected parameters. | |
module ValidateRequestParameters | |
# accept_only :string, :for => [:first_name, :last_name] | |
# accept_only :number, :for => :age | |
# accept_only :hash, :for => :categories | |
# accept_only :boolean, :for => :wants_newsletter | |
# accept_only String::VALID_POSTAL, :for => :postal_code | |
# accept_only /\d{3}\-\d{4}/, :for => :phone | |
module ClassMethods | |
def accept_only(param_type, options) |
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 | |
def test1 | |
begin | |
raise Exception.new("worked1") | |
rescue Exception => e | |
puts "caught exception1" | |
end | |
end |
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
# truncates html text to the desired text length. | |
# Like the Rails _truncate_ helper but doesn't break HTML tags or entities. | |
# | |
# accepts options: | |
# :link_to => url | |
def truncate_html(text, max_length = 400, options = {}) | |
return text if text.blank? | |
elipsis = '…' | |
tag_delimiter_count = 0 | |
in_html_entity = false |
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
INSTALLER_VERSION = "1.2.1" | |
=begin | |
Contact Info: | |
Tim Hunter, [email protected], http://rmagick.rubyforge.org | |
Usage: | |
See the README.rtf file that accompanies this script. | |
OlderNewer