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
$ wc -l app/controllers/legacy_controller.rb; cat spec/controllers/legacy_controller_spec.rb | |
83 app/controllers/legacy_controller.rb | |
cat: spec/controllers/legacy_controller_spec.rb: No such file or directory |
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
it "should return contest_ends_at in the proper time zone" do | |
e = Factory(:event) | |
e.contest_ends_at.utc_oftset.should == Time.zone.utc_offset | |
end | |
NoMethodError: undefined method `utc_oftset' for Mon Mar 01 15:59:59 UTC 2010:Time |
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
$(document).ready(function(){ | |
$("#loc-adv a").click(function(){ | |
$("#map").slideToggle("slow"); | |
return false; | |
}); | |
}); |
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
<!--- I'd like this ---> | |
<label for="merchant_name">Name | |
<input id="merchant_name" name="merchant[name]" size="30" type="text" /></label> | |
<label for="merchant_subdomain">Subdomain | |
<input id="merchant_subdomain" name="merchant[subdomain]" size="30" type="text" /> | |
<span class='subdomain'></span>.chargify.local is currently <span class='availability'>available.</span> | |
</label> | |
<label for="merchant_email">Email | |
<input id="merchant_email" name="merchant[email]" size="30" type="text" /></label> |
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
task :deploy, :roles => :live_web do | |
set(:deploy_tag) do | |
Capistrano::CLI.ui.ask "Tag to deploy to: " | |
end | |
die 'Tag must be longer than 4 characters' unless deploy_tag.length > 4 | |
`cd #{RAILS_ROOT} && ruby vendor/plugins/newrelic_rpm/bin/newrelic_cmd deployments -e production -r #{deploy_tag}` | |
do_deploy | |
end | |
serial_task :do_deploy, :roles => :live_web 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
iRoMac:dev bjclark$ gem list dch | |
*** LOCAL GEMS *** | |
dchelimsky-rspec (1.1.99.13, 1.1.99.6) | |
dchelimsky-rspec-rails (1.1.99.13, 1.1.99.6) | |
iRoMac:dev bjclark$ gem which dchelimsky-rspec-rails | |
Can't find ruby library file or shared library dchelimsky-rspec-rails | |
iRoMac:dev bjclark$ irb | |
irb(main):001:0> require 'rubygems' |
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
class SomeEvent | |
attr :attr1, :attr2 | |
def to_scribe | |
"#{attr1}\t#{attr2}\n" | |
end | |
end | |
Rails.scribe.event(SomeEvent.new("foo", "bar")) |
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 "ruby-prof" | |
require "mysql" | |
def print_profile(result) | |
if result | |
printer = RubyProf::FlatPrinter.new(result) | |
printer.print(STDOUT, 0) | |
else | |
puts "There are no result to print." |
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
<div class="entry-author"> | |
<address class="vcard"> | |
<span class="fn">Pat Maddox</span> | |
<span class="org">the science department</span> | |
<span class="email">[email protected]</span> | |
</address> | |
</div> | |
<script type="text/javascript" charset="utf-8"> | |
$('div.entry-author').find("address"). |