Skip to content

Instantly share code, notes, and snippets.

View joaovitor's full-sized avatar

Joao Vitor Lacerda Guimaraes joaovitor

  • Zero Hash
  • Belo Horizonte, MG, Brasil
View GitHub Profile
# config/deploy/hoptoad.rb.erb
HoptoadNotifier.configure do |config|
config.api_key = "<%=api_key%>"
config.environment_name = "<%=environment_name%>"
end
source :gemcutter
gem "rails", "3.0.0.rc"
gem "bundler", ">= 1.0.0.rc.4"
gem "state_machine", ">= 0.9.2"
gem "pg", "0.9.0"
gem "haml", ">= 3.0.4"
gem "compass", ">= 0.10.2"
gem "rails3-generators"
gem "inherited_resources", "1.1.2"
#!/bin/sh
apt-get install build-essential ssh ruby-full
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -snf /usr/bin/gem1.8 /usr/bin/gem
echo "gem: --no-ri --no-rdoc">$HOME/.gemrc
valor = 20.62
class Float
def +(value)
"Ahhhh pegadinha do malandro"
end
end
puts valor+2
# ...
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
#!/bin/sh
# http://blog.tinogomes.com/2010/02/24/ssh-copy-id-no-mac-os-x/
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f $KEY ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t dsa" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
# irbrc merged
# http://eustaquiorangel.com/posts/552
# http://gist.github.com/86875
require "irb/completion" # activate default completion
require 'irb/ext/save-history' # activate default history
require "tempfile" # used for Vim integration
require 'pp'
# save history using built-in options