Skip to content

Instantly share code, notes, and snippets.

View ravionrails's full-sized avatar
🧠
Brain at Work

Ravindra Singh ravionrails

🧠
Brain at Work
View GitHub Profile
@pozil
pozil / async-basics.js
Created June 15, 2020 18:35
Asynchronous JavaScript Cheatsheet
function callbackExample() {
setTimeout(_callback, 1000);
console.log('This appears instantaneously');
}
function promiseExample() {
_longRunningOperation()
.then(() => {
console.log('This appears later');
@lerua83
lerua83 / commitsTwoDates.txt
Created November 13, 2013 13:22
GIT - Get the commits that occured between two dates URL: http://stackoverflow.com/questions/1161609/in-git-how-can-i-get-the-diff-between-all-the-commits-that-occured-between-two How to obtain all the commits that occurred between two dates
git whatchanged --since="2 year ago" --until="1 year ago" [--author="NAME_OF_THE_AUTHOR"]
@aserafin
aserafin / resque.rake
Created October 10, 2013 10:10
clear all resque tasks from redis
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|
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# 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")
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')