Skip to content

Instantly share code, notes, and snippets.

View scottweisman's full-sized avatar

Scott Weisman scottweisman

View GitHub Profile
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
Remove existing files from the repository:
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
Add the line
.DS_Store
to the file .gitignore, which can be found at the top level of your repository (or created if it isn't there already). Then
git add .gitignore
git commit -m ".DS_Store banished"
# encoding: UTF-8
Capistrano::Configuration.instance(:must_exist).load do
namespace :rails do
desc "Open the rails console on one of the remote servers"
task :console, :roles => :app do
hostname = find_servers_for_task(current_task).first
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'"
end
end
SSH_USER = 'root'
SSH_HOST = 'www.example.com'
SSH_DIR = '/var/www/html/www.example.com'
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("middleman build --clean")
puts status ? "OK" : "FAILED"
end
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@scottweisman
scottweisman / chef_solo_bootstrap.sh
Created December 8, 2012 21:18 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@scottweisman
scottweisman / gitdeploy.md
Created November 6, 2012 16:30 — forked from rmanalan/gitdeploy.md
My Git Deploy Workflow

My Git Deploy Workflow

I use this for static and simple [Sinatra][1] based sites -- great for prototyping simple apps. Credit goes to http://toroid.org/ams/git-website-howto for the original idea.

If you don't know what this is, here's an example of how I deploy my website/app to a server:

# create/update/delete files in my site
git add .
git commit -m "description of the changes I made"

git push

@scottweisman
scottweisman / gist:3484894
Created August 27, 2012 01:24 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@scottweisman
scottweisman / gist:2782213
Created May 24, 2012 15:23 — forked from JeffCohen/gist:2782207
Vending Machine Fun
class VendingMachine
# attr_accessor :money
def initialize(number_of_cans)
@cans = []
number_of_cans.times do
@cans << 'Coke'
end
# => ['Coke', 'Coke', 'Coke', 'Coke']