Skip to content

Instantly share code, notes, and snippets.

# ...
namespace :bundler do
task :create_symlink, :roles => :app do
shared_dir = File.join(shared_path, 'bundle')
release_dir = File.join(current_release, '.bundle')
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}")
end
task :bundle_new_release, :roles => :app do
gem 'sunspot_rails', :require => 'sunspot/rails'
@DixcomWeb
DixcomWeb / News Cloud App Setup
Created February 7, 2011 16:38
Most of the necessary installs and configurations for setting up a News Cloud EC2 instance
# Update and install packages
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude install apache2 build-essential libapache2-mod-passenger linux-headers-generic git-core zlib1g-dev libmysqlclient-dev
# Install Latest Ruby
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz
tar -xzf ruby-1.9.2-p136.tar.gz
rm -f ruby-1.9.2-p136.tar.gz
cd ruby-1.9.2-p136/
@DixcomWeb
DixcomWeb / News Cloud DB Setup
Created February 7, 2011 17:42
Most of the necessary installs and configurations for setting up a News Cloud Mongo server
# Update and install required packages
sudo aptitude update
sudo aptitude safe-upgrade
.DS_Store
*.csv
*.pdf
@DixcomWeb
DixcomWeb / confident.rb
Created May 21, 2011 16:40 — forked from afair/confident.rb
Notes on Advi Grimm's "Confident Code" talk
# http://avdi.org/talks/confident-code-2010-01-12/confident-code.html
# Narrative structure: Four Parts
#==========================================================
# Gather input:
# Coerce
param.to_s #to_i #to_sym Array() ... use liberally!
messages = Array(messages)
# Decorators
@DixcomWeb
DixcomWeb / pages_controller.rb
Created April 18, 2012 11:54 — forked from patrickberkeley/pages_controller.rb
using Paperclip for multiple attachments and displaying them using the method described in Advanced Rails Recipe #13
class PagesController < ApplicationController
before_filter :login_required, :except => [ :show ]
# GET /pages
# GET /pages.xml
def index
@pages = Page.find(:all)
respond_to do |format|
format.html # index.html.erb