Skip to content

Instantly share code, notes, and snippets.

View usmanity's full-sized avatar

Muhammad Usman usmanity

View GitHub Profile
@usmanity
usmanity / rails_404.rb
Created August 4, 2011 07:57
quick way to forward errors from a rails app to 404. suggest something better if this isn't the best way to go about this
def method_missing(id, *args)
redirect_to '/404.html'
end
@usmanity
usmanity / MacVim alias
Created September 19, 2011 23:47
short and you'll be surprised how easy it is to type on the keyboard. opens mvim from CLI and displays: Opening MacVim..
alias 'm.'='mvim .;echo "Opening MacVim..."'
@usmanity
usmanity / gist:1233450
Created September 21, 2011 22:00
Pull first and if no conflicts, do a push
git pull [optional filename] && git push [optional filename]
sass --watch public/sass:public/stylesheets --style compact
git checkout -b new_branch --track origin/branch_to_checkout
<script>document.createElement("figure");</script>
alias 'dropitlikeitshot'='echo "dropping, creating, migrating and seeding DB...";
rake db:drop db:create db:migrate && rake db:seed'
ack 'padding:.*.40px'
alias 'protect_ya_neck'='guard -G guard_files/sass & guard -G guard_files/live_reload'
defaults write NSGlobalDomain KeyRepeat -int 0