Skip to content

Instantly share code, notes, and snippets.

View andrehjr's full-sized avatar

André Luis Leal Cardoso Jr andrehjr

  • Florianópolis, Imbituba - SC - Brazil
View GitHub Profile
require 'rubygems'
require 'active_support'
require 'set'
a = [ 'q1', 'q2', 'q3', 'q4' , 'q5', 'q6'] #, 'q3', 'q4', 'q5'] #, 'q3', 'q4' ]
new_test = []
a.each_with_index do |item, index|
# Install hook code here
puts "Rails.root.nil? => #{Rails.root.nil?}"
puts "Rails.env #{Rails.env}"
class CiJoe < Thor
include Thor::Actions
desc "instal_ci_for [project] [git_clone_url]", "install project for cijoe.\nYou must be builder directory (just for now)"
def install_ci_for(project, clone_url)
if File.exists? "cijoe-repos"
empty_directory "cijoe-repos/#{project}/public"
clone project, clone_url
build_links project
@andrehjr
andrehjr / error
Created September 27, 2010 22:41
Arguments
"notify"
{"class"=>"Array", "value"=>"BAhbCCIJd29vdCIXYW5kcmVoanJAZ21haWwuY29tIg1jZjQ2YzQ0Ng=="}
Exception
NameError
Error
uninitialized constant DebtorInvitationMailer
@andrehjr
andrehjr / nginx.conf
Created December 11, 2010 00:55
my nginx conf
#user staff;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
addEvent(window, 'load', initCorners);
function initCorners() {
var settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true
}
curvyCorners(settings, ".box");
@andrehjr
andrehjr / nginx.conf
Created January 4, 2011 09:41
nginx.conf with basic_auth
$ sudo htpasswd -c -d /opt/nginx/conf/htpasswd andrehjr
@andrehjr
andrehjr / gist:881647
Created March 22, 2011 17:35
BigDecimal#to_yaml fails on rails 3.0.4.
# This is only happening in production
# :/
# Any Ideas how to fix?
Loading production environment (Rails 3.0.4)
ruby-1.9.2-p136 :001 > BigDecimal.new("0.33")
=> #<BigDecimal:73fc940,'0.33E0',9(18)>
ruby-1.9.2-p136 :002 > BigDecimal.new("0.33").to_yaml
# rvm-install added line:
if [[ -s /Users/andrehjr/.rvm/scripts/rvm ]] ; then source /Users/andrehjr/.rvm/scripts/rvm ; fi
export RUBYOPT="-ropenssl"
rvm use ruby-1.9.2-p136
alias ss='script/server'
alias sc='script/console'
alias rs='rails s'
brew link libxml2
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib