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
@joaovitor
joaovitor / gist:fb2b3cdbf26a1ce5bd3e
Created September 26, 2014 10:26
Resposta ao link do dicasl do dia 26/09/2014 - http://www.dicas-l.com.br/dicas-l/20140926.php
$ cat ~/.bash_history | cut -f 1 -d\ | sort | uniq -c | sort -r | head
3385 git
3138 gs
2276 cd
2093 ll
563 gsr
497 gd
337 for
274 exec-git-command.sh
265 mvn
# 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
#!/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! *"
# ...
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
valor = 20.62
class Float
def +(value)
"Ahhhh pegadinha do malandro"
end
end
puts valor+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
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"
# config/deploy/hoptoad.rb.erb
HoptoadNotifier.configure do |config|
config.api_key = "<%=api_key%>"
config.environment_name = "<%=environment_name%>"
end
infinity_test do
notifications :growl do
show_images :mode => :faces
end
use :test_framework => :rspec
before_run do
clear :terminal
end
@joaovitor
joaovitor / benchmark-output.txt
Created December 20, 2010 23:26
output of: rails runner lib/benchmark_parser.rb
user system total real
file_new_parser 65.520000 0.370000 65.890000 ( 68.159821)
string_new_parser 71.690000 0.290000 71.980000 ( 74.296380)
old_parser 119.490000 1.880000 121.370000 (132.974209)