Skip to content

Instantly share code, notes, and snippets.

@netzpirat
netzpirat / deploy.rb
Created May 14, 2009 10:06
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production
# Use at least one worker per core
worker_processes 16
# Help ensure your application will always spawn in the symlinked "current" directory that Capistrano sets up
working_directory "/var/www/apps/superfeedr.com/current"
# Listen on a Unix domain socket, use the default backlog size
listen "/tmp/unicorn.sock", :backlog => 1024
# Nuke workers after 30 seconds instead of 60 seconds (the default)
@josegonzalez
josegonzalez / .gitconfig
Created September 5, 2010 07:45
My ~/.gitconfig
[user]
name = MY_NAME
email = MY_EMAIL_ADDRESS
[git-tmbundle]
gitnub-path = /Applications/GitNub.app
gitx-path = /Applications/GitX.app
show-diff-check = yes
[github]
user = GITUB_USER
token = GITHUB_TOKEN
source 'http://rubygems.org'
# --------------------
# Rails
# --------------------
#gem 'arel', :git => 'git://github.com/rails/arel.git'#, :branch => '1-0-stable'
gem 'rails', '~> 3.0.3'
# gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '3-0-stable'
# --------------------
class AppBuilder < Rails::AppBuilder
include Thor::Actions
include Thor::Shell
def test
append_test_gems
rspec
cucumber
jasmine
end
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@kalbasit
kalbasit / capistrano_database_yml
Created May 31, 2011 13:34
Capistrano RVM Unicorn
#
# = 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 <weppos@weppos.net>
# Copyright:: 2007-2010 The Authors
@vinioliveira
vinioliveira / Additional Commands
Created June 30, 2011 00:04
Init.d Juggernaut2 script for Ubuntu
$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group juggernaut
$ sudo mv ~/juggernaut2-for-init.d-startup.sh /etc/init.d/juggernaut
$ sudo chmod +x /etc/init.d/juggernaut
$ sudo update-rc.d -f juggernaut defaults