$ rails g model User
belongs_to
has_one
| ❷ > QUEUE=* rake resque:work --trace | |
| ** Invoke resque:work (first_time) | |
| ** Invoke resque:preload (first_time) | |
| ** Invoke resque:setup (first_time) | |
| ** Execute resque:setup | |
| ** Execute resque:preload | |
| rake aborted! | |
| No such file to load -- devise/confirmations_controller | |
| /Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:306:in `rescue in depend_on' | |
| /Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:301:in `depend_on' |
| <!-- Add the following lines to theme's html code right before </head> --> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
| <script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
| <script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
| <!-- | |
| Usage: just add <div class="gist">[gist URL]</div> | |
| Example: <div class="gist">https://gist.github.com/1395926</div> | |
| --> |
| --- | |
| layout: default | |
| --- | |
| <div class="blog-index"> | |
| {% assign post = site.posts.first %} | |
| {% assign content = post.content %} | |
| {% include post_detail.html %} | |
| </div> |
| after "deploy:symlink", "deploy:restart_workers" | |
| after "deploy:restart_workers", "deploy:restart_scheduler" | |
| ## | |
| # Rake helper task. | |
| # http://pastie.org/255489 | |
| # http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
| # http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
| def run_remote_rake(rake_cmd) | |
| rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
| #!/usr/bin/env ruby | |
| # This pre-commit hook will prevent any commit to forbidden branches | |
| # (by default, "staging" and "production"). | |
| # Put this file in your local repo, in the .git/hooks folder | |
| # and make sure it is executable. | |
| # The name of the file *must* be "pre-commit" for Git to pick it up. | |
| FORBIDDEN_BRANCHES = ["staging", "production"] |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| #!/usr/bin/env bash | |
| uninstall() { | |
| list=`gem list --no-versions` | |
| for gem in $list; do | |
| gem uninstall $gem -aIx | |
| done | |
| gem list | |
| gem install bundler | |
| } |
| #!/bin/sh | |
| # | |
| # Automatically adds branch name and branch description to every commit message. | |
| # | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| DESCRIPTION=$(git config branch."$NAME".description) | |
| TEXT=$(cat "$1" | sed '/^#.*/d') | |
| if [ -n "$TEXT" ] | |
| then |