Skip to content

Instantly share code, notes, and snippets.

# Bash prompt showing current git branch & marking if dirty:
# Based on http://henrik.nyh.se/2008/12/git-dirty-prompt
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
gc my-branch                  # always work on a local branch

gca "some commit message"     # commit early, commit often

gfom && grom;                 # fetch and merge often

gca "some commit message"     # last commit before merge

git rebase -i origin/master   # interactive rebase to squash commits and make nice commit log
###
alias gs='git status'
alias gca='git commit -a -m'
alias gcm='git commit -m'
alias gb='git branch'
alias gd='git diff'
alias gfo='git fetch origin'
alias gfom='git fetch origin master'
alias grom='git rebase origin/master'
config.gem 'devise', :version => '>=1.0.0'
class User < ActiveRecord::Base
devise :all
config.gem 'devise'
ActionView::TemplateError (undefined local variable or method `new_user_session_path' for #<ActionView::Base:0x243fca4>) on line #27 of app/views/shared/_header.html.haml: 24: 25: - else 26: %li= link_to "Join", join_url 27: %li= link_to "Sign In", new_user_session_path
class User < ActiveRecord::Base
devise :authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
Devise.setup do |config|
...
config.mailer_content_type = 'text/plain'
gem install glennr-devise
or
config.gem 'glennr-devise', :lib => 'devise', :source => 'http://gemcutter.org'