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
function callbackExample() { | |
setTimeout(_callback, 1000); | |
console.log('This appears instantaneously'); | |
} | |
function promiseExample() { | |
_longRunningOperation() | |
.then(() => { | |
console.log('This appears later'); |
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 whatchanged --since="2 year ago" --until="1 year ago" [--author="NAME_OF_THE_AUTHOR"] |
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
desc "Clear pending tasks" | |
task "resque:clear" => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." | |
Resque.redis.del "queue:#{queue_name}" | |
end | |
puts "Clearing delayed..." # in case of scheduler - doesn't break if no scheduler module is installed | |
Resque.redis.keys("delayed:*").each do |key| |
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 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |