Skip to content

Instantly share code, notes, and snippets.

View cherring's full-sized avatar
💭
Why do we even need this?

Chris Herring cherring

💭
Why do we even need this?
View GitHub Profile
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
# Hot deploy Rails apps (rolling restart) with Capistrano, Haproxy, and cluster of Passengers
# Capistrano config
namespace :passenger do
task :disable_load_balancing, :roles => :app do
run "rm -f #{current_path}/public/http-check.txt"
end
task :enable_load_balancing, :roles => :app do
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell))
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.1
# Use the ruby + gem set
∴ rvm 1.9.1%rails3
# Edit this Gemfile to bundle your application's dependencies.
## Bundle edge rails:
gem "rails", :git => "git://github.com/rails/rails.git"
## Bundle the gems you use:
# gem "bj"
# gem "hpricot", "0.6"
# gem "sqlite3-ruby", :require_as => "sqlite3"
# gem "aws-s3", :require_as => "aws/s3"
# Factory girl, relaxed.
#
# Factory.define :user do |f|
# f.login 'johndoe%d' # Sequence.
# f.email '%{login}@example.com' # Interpolate.
# f.password f.password_confirmation('foobar') # Chain.
# end
#
# Factory.define :post do |f|
# f.user { Factory :user } # Blocks, if you must.
grey='\e[0;90m'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
function pat_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
Feature: Generate a new Synapse app
lorem ipsum else
Scenario: Generate a new synapse app
Given I have no synapse app "my/new/app" # Test that there are no files/dirs for the app
When I generate a synapse app "my/new/app" # Trigger the app build
Then I should have the generated files for "my/new/app" # Test that all the files are there, Use an after hook to get rid of them after
.input
= f.text_area :body
= f.hidden_field :commented_by, :value => current_user.email
# Postgres backup script
# mynameisrufus
#
# Cron tab examples:
#
# daily keeping the last 5 days (run at 1:00AM, 2 minutes after the hour)
#
# 02 1 * * * postgres /script/db_backup.sh daily /var/backups/db $DATABASE_OWNER 5 >> /var/backups/db/backup.log 2>&1
#
#
require 'steak'
require 'capybara'
require 'capybara/dsl'
require 'rack/test'
RSpec.configure do |config|
def app
Capybara.app
end
config.include Capybara