Skip to content

Instantly share code, notes, and snippets.

View mr-dxdy's full-sized avatar

German Antsiferov mr-dxdy

View GitHub Profile
# .gitconfig
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
@mr-dxdy
mr-dxdy / gist:9480871
Created March 11, 2014 07:03
How to get the current_user in a model observer? Solution!
# install devise
# rails generate devise user
# rails g scaffold task name:string description:text
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
around_filter :set_current_user_for_thread
protect_from_forgery