Skip to content

Instantly share code, notes, and snippets.

View cairesr's full-sized avatar
🏠
Working from home

Rodrigo Caires Rossetti Gai cairesr

🏠
Working from home
View GitHub Profile
@apieceofbart
apieceofbart / test.js
Created February 21, 2018 13:15
mock lodash debounce in jest
// somewhere on top
import _ from 'lodash';
jest.unmock('lodash');
// then
_.debounce = jest.fn((fn) => fn);
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@mdornseif
mdornseif / dedupe.sql
Created December 25, 2010 10:05
Dedutpe Table buchdurchschnittspreis2
DELETE FROM buchdurchschnittspreis2
WHERE id in
(SELECT buchdurchschnittspreis2.id FROM buchdurchschnittspreis2
LEFT OUTER JOIN (select min(id) as id from buchdurchschnittspreis2
GROUP BY (artnr, datum) as KeepRows
ON buchdurchschnittspreis2.id=KeepRows.id
WHERE KeepRows.id IS NULL);
@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')