Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Edmond, OK
  • 22:38 (UTC -12:00)
  • X @rrichards
View GitHub Profile
=begin
Capistrano deployment email notifier for Rails 3
Do you need to send email notifications after application deployments?
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html.
Here is Rails 3 port of the notifier.
The notifier sends an email after application deployment has been completed.
@rrichards
rrichards / install_rvm.rb
Created May 17, 2011 17:36 — forked from dreamcat4/install_rvm.rb
Install RVM to /usr/local - as admin group
#!/usr/bin/env ruby
#
# One-liner
# curl -fsS https://gist.github.com/raw/542746/install_rvm.rb | ruby -e '$script=STDIN.read;eval $script'
#
# This script installs to /usr/local only. It assumes theres an
# admin group on your system - either "wheel", "admin", or "staff"
#
# Sudo is used a few times during the initial install. But anyone
# in admin group can manage rvm (regardless of sudo privelidges)
# An example of using Cloudkick's oauth API. Make sure the
# key you're using has read/write privileges (the default
# is just execute privileges). You'll need the json and
# the oauth gems installed as well for this to work properly.
require 'rubygems'
require 'oauth'
require 'json'
# make the consumer out of your secret and key
@rrichards
rrichards / install_rvm.rb
Created June 4, 2011 17:26 — forked from dreamcat4/install_rvm.rb
Install RVM to /usr/local - as admin group
#!/usr/bin/env ruby
#
# One-liner
# curl -fsS https://gist.github.com/raw/542746/install_rvm.rb | ruby -e '$script=STDIN.read;eval $script'
#
# This script installs to /usr/local only. It assumes theres an
# admin group on your system - either "wheel", "admin", or "staff"
#
# Sudo is used a few times during the initial install. But anyone
# in admin group can manage rvm (regardless of sudo privelidges)
@rrichards
rrichards / bdd.vim
Created July 15, 2011 13:05 — forked from heisters/bdd.vim
Run RSpec and Cucumber from vim, on the current spec/feature
" Vim functions to run RSpec and Cucumber on the current file and optionally on
" the spec/scenario under the cursor. Within the context of a Rails app, will
" prefer script/spec and script/cucumber over their system counterparts.
function! RailsScriptIfExists(name)
" Bundle exec
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle"))
return "bundle exec " . a:name
" Script directory
elseif exists("b:rails_root") && filereadable(b:rails_root . "/script/" . a:name)
return b:rails_root . "/script/" . a:name
@rrichards
rrichards / init.el
Created July 27, 2011 05:15 — forked from mig/init.el
Simple Emacs 24 configuration for Rails development
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
@rrichards
rrichards / Gemfile
Created September 20, 2011 21:13 — forked from chriseppstein/readme.md
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass', '~> 0.12.alpha'
# include other compass plugins here. E.g.:
gem 'compass-susy-plugin', :require => 'susy'
end
@rrichards
rrichards / Gemfile
Created September 25, 2011 13:49 — forked from mislav/Gemfile
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass'
end
@rrichards
rrichards / chef-server-ubuntu-natty-userdata.sh
Created September 27, 2011 23:53 — forked from hh/chef-server-ubuntu-natty-userdata.sh
Chef Server setup for Ubuntu 11.04/natty on Amazon ec2
#!/bin/bash
#ec2-run-instances --user-data-file chefserver-ec2-userdata.sh -g chef-server --key mykey -t m1.large --instance-initiated-shutdown-behavior terminate ami-1aad5273 | grep INSTANCE | INSTANCE=`cut -f 2` | xargs -I XXX ec2-create-tags XXX --tag Name=chefserver ; sleep 60 ; ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | echo ssh ubuntu@`cut -f 4`
# ami-1aad5273 - ubuntu 11.04 64bit server ebs
# ami-2cc83145 - alestic ubunt 10.04 LTS 32bit server ebs
# ami-2ec83147 - alestic ubunt 10.04 LTS 64bit server ebs
# ami-8e1fece7 - amazon 64 bit ebs
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
set -e -x
# START CHEF BOOSTRAP
@rrichards
rrichards / rails31init.md
Created November 17, 2011 05:14 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile