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
| Loading development environment (Rails 2.2.2) | |
| config/environment.rb inside of Rails::Initializer.run block | |
| config/environments/development.rb | |
| vendor/plugins/ | |
| config/initializers | |
| config/environment.rb inside of config.after_initialize block | |
| gems in GEM_PATHS | |
| lib/ | |
| Constants in lib/ are autoloaded when the constant is missing. |
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 'benchmark' | |
| n = 50000 | |
| # s = "" | |
| # when 's' is global the benchmark runs much slower | |
| Benchmark.bmbm do |x| | |
| x.report("+=") do | |
| s = "" | |
| n.times { s += "." } | |
| 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
| # ARCHFLAGS may or may not matter - I set mine up this way just in case. | |
| ~$ echo $ARCHFLAGS | |
| -arch i386 -arch x86_64 | |
| # Be sure to compile ruby with --enable-shared | |
| ~$ rvm install 1.9.1 --debug --reconfigure -C --enable-shared=yes | |
| # Test to ensure that --enable-shared worked | |
| ~$ ruby -e "require 'rbconfig'; puts Config::CONFIG['ENABLE_SHARED']" | |
| yes |
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 'rev' | |
| class SomeWatcher < Rev::StatWatcher | |
| def initialize(watch_path) | |
| super(watch_path) | |
| puts "watching #{path}" | |
| end | |
| def on_change |
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
| Error detected while processing CursorHold Auto commands for "*": | |
| E303: Unable to open swap file for "[No Name]", recovery impossible |
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
| diff --git a/lib/rspactor/listener.rb b/lib/rspactor/listener.rb | |
| index c2d70b2..0990045 100644 | |
| --- a/lib/rspactor/listener.rb | |
| +++ b/lib/rspactor/listener.rb | |
| @@ -1,56 +1,33 @@ | |
| -require 'osx/foundation' | |
| -OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework' | |
| +require 'rubygems' | |
| +require 'fsevent' | |
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
| # override the parsing for all formats, always return :sexy => true | |
| class CustomParser < HTTParty::Parser | |
| def parse | |
| {:sexy => true} | |
| end | |
| end | |
| # only change the way json is parsed | |
| class CustomJsonParser < HTTParty::Parser | |
| def json |
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
| # add the contributor's fork as a remote | |
| # use '-f' to fetch their branches | |
| git remote add -f contributor git://github.com/contributor/project.git | |
| # checkout a new branch for the patch | |
| git co -b fix_bug_branch contributor/fix_bug_branch | |
| # rebase master into the branch | |
| git rebase master |
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 | |
| =begin | |
| Author: Sandro Turriate | |
| Permalink: http://gist.github.com/272583 | |
| DESCRIPTION | |
| ----------- | |
| Turn a Pivotal Tracker story id into the name of that story. |
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
| alias gem_console='irb -I lib -r lib/*.rb' |