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
locals: &locals | |
host: localhost | |
adapter: mysql | |
username: <username> | |
password: <password> | |
pool: 5 | |
timeout: 5000 | |
# socket: /Application/MAMP/tmp/mysql/mysql.sock | |
development: |
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
# server user ~/.rvmrc | |
export rvm_path="/path/to/users/.rvm" | |
export rvm_trust_rvmrcs_flag=1 |
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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
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
(1..100).each do |n| | |
puts case | |
when (n % 3) == 0 | |
"Fizz" | |
when (n % 5) == 0 | |
"Buzz" | |
when (n % 3) == 0 && (n % 5) == 0 | |
"FizzBuzz" | |
else | |
n |
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 :be_from do |expected| | |
match do |actual| | |
actual.from_addrs.include?(expected) | |
end | |
failure_message_for_should do |actual| | |
%{expected to be from #{expected} but was from #{actual.from_addrs.join(', ')}} | |
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
$.ajax({ | |
error: function(jqXHR, textStatus, errorThrown) { | |
// reset | |
$('.formtastic li').removeClass("error"); | |
$('.formtastic li .inline-errors').remove(); | |
// set the errors | |
// TODO turn into dynamic | |
// TODO include errors for :base and #semantic_errors | |
var errors = ko.mapping.toJS(ko.mapping.fromJSON(jqXHR.responseText)); |
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
set shell=bash | |
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! |
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
# Rails < 3 | |
class CustomerLocation < ActiveRecord::Base | |
def self.model_name | |
ActiveSupport::ModelName.new("Location") | |
end | |
end | |
# ActiveSupport::ModelName is moved or deprecated after 3 |
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
gem 'chronic' | |
group :development, :test do | |
gem "foreman" | |
# group :test do | |
# Pretty printed test output | |
gem 'turn', '0.8.2', :require => false | |
gem "capybara" |
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_received_an_email do |expected| | |
def last_email | |
@last_email ||= ActionMailer::Base.deliveries.last | |
end | |
def inbox_size | |
ActionMailer::Base.deliveries.size | |
end | |
def to |