This file contains hidden or 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
RSpec::Matchers.define :have_link_to do |expected| | |
match do |actual| | |
actual.has_xpath?("//a[@href=\"#{expected}\"]") | |
end | |
end |
This file contains hidden or 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
RSpec::Matchers.define :have_normal_content do |expected| | |
match do |actual| | |
actual.text.squish =~ Regexp.new(expected) | |
end | |
failure_message_for_should do |actual| | |
"expected content '#{expected}' in normalized text '#{actual.text.squish}'" | |
end | |
failure_message_for_should_not do |actual| |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
private | |
def current_user | |
@current_user ||= User.find(session[:user_id]) if session[:user_id] | |
end | |
helper_method :current_user |
This file contains hidden or 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
#wrapper { | |
background-image: url("image.png"); | |
width: 80px; /* the image width is 100px; */ | |
padding-right: 20px; | |
margin-right: -20px; | |
} |
This file contains hidden or 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 "build website" | |
task :build do | |
system "rm -rf build/*" | |
system "middleman build" | |
puts "## Build complete" | |
puts "To deploy, see the deploy task." | |
puts <<-eos | |
## If this is your first deploy and the gh-pages branch does not exist, run the following: |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Backup a Postgresql database into a daily file. | |
# | |
BACKUP_DIR=/pg_backup | |
DAYS_TO_KEEP=14 | |
FILE_SUFFIX=_pg_backup.sql | |
DATABASE= | |
USER=postgres |
This file contains hidden or 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 fill_in_select2(selector, options={}) | |
page.find(:css, "#s2id_#{selector} a").click | |
page.find(:css, ".select2-search input.select2-input").set options[:with] | |
page.find(:css, ".select2-result-label").click # Choose the first result | |
end |
This file contains hidden or 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
@mixin bleed($padding: $grid-padding, $sides: left right) { | |
@if $sides == 'all' { | |
margin: - $padding; | |
padding: $padding; | |
} @else { | |
@each $side in $sides { | |
margin-#{$side}: - $padding; | |
padding-#{$side}: $padding; | |
} | |
} |
This file contains hidden or 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
forge "http://forge.puppetlabs.com" | |
mod 'hunner/wordpress' | |
mod 'puppetlabs/apache' | |
mod 'b0d0nne11/vim' |
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
config.vm.box = "dummy" | |
config.ssh.private_key_path = "PRIVATE_KEY" | |
config.vm.provider :rackspace do |rs| | |
rs.username = "USER" | |
rs.api_key = "KEY" | |
rs.flavor = /512MB/ | |
rs.image = /Ubuntu/ |
OlderNewer