Skip to content

Instantly share code, notes, and snippets.

View victormartins's full-sized avatar
💭
:shipit: Connecting the dots

Victor Martins victormartins

💭
:shipit: Connecting the dots
View GitHub Profile
function github {
branch="$(git rev-parse --abbrev-ref HEAD)"
url="$(git config --get remote.upstream.url)"
url=${url/git@github.com:/http://github.com/}
url=${url/.git/}
if [[ $1 =~ "compare" ]]; then action="compare"
elif [[ $1 =~ "pr" ]]; then action="pull"
else action="tree"; fi
# How Clearance / Hoptoad does it
module Clearance
class << self
attr_accessor :configuration
end
def self.configure
self.configuration ||= Configuration.new
yield(configuration)
end
@victormartins
victormartins / capybara cheat sheet
Created December 11, 2011 10:17 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
DOCS: http://rubydoc.info/github/jnicklas/capybara/master/file/README.rdoc
=Navigating=
visit('/projects')
visit(post_comments_path(post))
current_path.should == post_comments_path(post)
=Clicking links and buttons=
click_link('id-or-text')
click_button('id-or-text')