ssh root@<ip_address>
apt-get -y update
apt-get -y install curl git-core python-software-properties
apt-get -y install software-properties-common # ubuntu >= 12.10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Devise | |
module Strategies | |
class Token < Base | |
attr_reader :email, :token | |
def initialize(env, scope = nil) | |
super | |
return unless auth = ActionController::HttpAuthentication::Token.token_and_options(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run brew install git bash-completion | |
# Add bash-completion to your ~/.bash_profile: | |
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion || { | |
# if not found in /usr/local/etc, try the brew --prefix location | |
[ -f "$(brew --prefix)/etc/bash_completion.d/git-completion.bash" ] && \ | |
. $(brew --prefix)/etc/bash_completion.d/git-completion.bash | |
} | |
DULL=0 | |
BRIGHT=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Kill resque workers" | |
task :kill_processes, :roles => :god, :on_no_matching_servers => :continue do | |
run "cd #{deploy_to}/current && rake resque:restart_workers RAILS_ENV=#{rails_env}" do |ch, stream, data| | |
puts data | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if lookup_context.template_exists?("custom_header/#{@object.key}", 'parent_path', true) %> | |
<%= render "custom_header/#{@object.key}" %> | |
<% else %> | |
Stock header | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// Support for AJAX loaded modal window. | |
// Focuses on first input textbox after it loads the window. | |
$('[data-toggle="modal"]').click(function(e) { | |
e.preventDefault(); | |
var url = $(this).attr('href'); | |
if (url.indexOf('#') == 0) { | |
$(url).modal('open'); | |
} else { |
Write a good commit message.
[#123] Summary of changes under 50 characters
* More information about commit (under 72 characters)
* More information about commit (under 72 characters)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sunspot | |
module Search | |
class AbstractSearch | |
private | |
def maybe_will_paginate(collection) | |
collection.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 | |
def current_page | |
#{@query.page} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in /Users/lar/Sites/formtastic) | |
.............................................................................................................................................................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................FF.FFFF..FF..............FF......................... | |
Failures: | |
1) check_boxes input for a has_many association should have input wrapper with class 'check_boxes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Joins < ActiveRecord::Base | |
belongs_to :parent | |
belongs_to :child | |
validates_presence_of :parent_id, :child_id | |
end | |
class Parent < ActiveRecord::Base | |
has_many :joins | |
has_many :children, |
NewerOlder