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
# .powrc | |
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then | |
source "$rvm_path/scripts/rvm" | |
rvm use `cat .ruby-version`@`cat .ruby-gemset` | |
fi |
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
# Make mouse useful in copy mode | |
setw -g mode-mouse on | |
# Allow mouse to select which pane to use | |
set -g mouse-select-pane on | |
# Allow mouse dragging to resize panes | |
set -g mouse-resize-pane on | |
# Allow mouse to select windows |
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
# spec/support/database_cleaner.rb | |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = :transaction | |
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
# Returns the Gravatar (http://gravatar.com) for the given user. | |
def gravatar_for(user, options = {size: 40}) | |
gravatar_id = Digest::MD5::hexdigest(user.email.downcase) | |
size = options[:size] | |
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}" | |
image_tag(gravatar_url, alt: user.full_name) | |
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
jQuery.fn.elementAfter = function(other) { | |
for(i = 0; i < this.length - 1; i++) { | |
if (this[i]() == other) { | |
return jQuery(this[i + 1]()); | |
} | |
} | |
}; | |
jQuery.fn.elementBefore = function(other) { | |
if (this.length > 0) { |
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
require 'spec_helper' | |
feature "User interact with the queue" do | |
scenario "User adds and reorders videos in the queue" do | |
comedies = Fabricate(:category) | |
monk = Fabricate(:video, title: "Monk", categories: [comedies]) | |
south_park = Fabricate(:video, title: "South Park", categories: [comedies]) | |
futurama = Fabricate(:video, title: "Futurama", categories: [comedies]) | |
sign_in |
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
def sign_in(a_user=nil) | |
user = a_user || Fabricate(:user) | |
visit signin_path | |
fill_in "Email", with: user.email | |
fill_in "Password", with: user.password | |
click_button "Sign in" | |
end |