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
# If you have installed new relic as a gem | |
# add this to the bottom of your deploy file (deploy.rb) | |
require 'new_relic/recipes' | |
set :newrelic_appname, "YourAppNameAsItAppearsInNewRelicAccount" | |
after "deploy:update", "newrelic:notice_deployment" |
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
Usage: rspec [options] [files or directories] | |
-b, --backtrace Enable full backtrace | |
-c, --[no-]color, --[no-]colour Enable color in the output | |
-d, --debug Enable debugging | |
-e, --example PATTERN Run examples whose full descriptions match this pattern | |
(PATTERN is compiled into a Ruby regular expression) | |
-f, --format FORMATTER Choose a formatter | |
[p]rogress (default - dots) | |
[d]ocumentation (group and example names) | |
[h]tml |
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
$ rspec spec --format documentation |
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
$ rspec spec --format documentation > ~/myproject.txt |
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
$ rspec --help |
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
Event.observe(window,'load',function(){ | |
$('parent-id').observe('click',function(event){ | |
var element = event.findElement('css_selector_of_our_target_newly_arrived_element'); | |
if(element.tagName == 'tag_in_caps'){ | |
//do anything | |
} | |
}); | |
}); |
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
Event.observe(window,'load',function(){ | |
$('content').observe('click',function(event){ | |
var element = event.findElement('a.item'); | |
if(element.tagName == 'A'){ | |
alert("got you....."); | |
} | |
}); | |
}); |
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 "goshortener" | |
=> true | |
> go = GoShortener.new("yourapikeyfromgoogle") | |
=> #<GoShortener:0x10056e6a8 @base_url="https://www.googleapis.com/urlshortener/v1/url", @api_key="yourapikeyfromgoogle"> | |
> go.shorten("http://github.com/luckydev") | |
=> "http://goo.gl/TCZHi" | |
> go.lengthen("http://goo.gl/TCZHi") | |
=> "http://github.com/luckydev" |
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 Person | |
def say_hi | |
puts "Hi, Do you like Ruby?" | |
end | |
end | |
john = Person.new | |
john.say_hi | |
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
Person = Class.new | |
module PersonInstanceMethods | |
def say_hi | |
puts "Hi, Do you like Ruby?" | |
end | |
end | |
Person.send(:include, PersonInstanceMethods) | |
john = Person.new |