Skip to content

Instantly share code, notes, and snippets.

Pineapple a day keeps a pinedoctor away

Alexander Mankuta pointlessone

Pineapple a day keeps a pinedoctor away
View GitHub Profile
AndrewRadev /
Last active Oct 21, 2018
Keep track of a long-running process
# Given a long-running process in the terminal:
# - Ctrl+Z to suspend it
# - Run `keep-track`
# - Output resumes, when done will show a notification with the time it took for the process to run
# Can be customized with an `--icon` to `notify-send`,
# maybe a sound effect added in the `&&` list.
function keep-track() {
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

leshill / gist:870866
Created Mar 15, 2011
Cucumber/Capybara JS alert handling
View gist:870866
# Add this to more_web_steps.rb
# Selenium docs: today!
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text|
alert = page.driver.browser.switch_to.alert
alert.text.should eq(text)
tpope / .gitattributes
Created Oct 24, 2010
Fewer conflicts in your Rails apps
View .gitattributes
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema