Skip to content

Instantly share code, notes, and snippets.

View emaiax's full-sized avatar
🌵

Eduardo Maia emaiax

🌵
View GitHub Profile
@emaiax
emaiax / fix-nokogiri
Created March 21, 2012 18:31 — forked from martinisoft/fix-nokogiri.md
Nokogiri working install with latest XCode
Homebrew has blacklisted libiconv so the majority of your help via google will not work now.
Here's a way I figured out how to get nokogiri to compile if you made the mistake of upgrading your XCode version and you use RVM
1. Install packages via RVM
rvm pkg install libxslt
rvm pkg install libxml2
rvm pkg install iconv
2. Tell bundler how to build this by default
bundle config build.nokogiri --with-opt-dir=$rvm_home/usr
@emaiax
emaiax / 0-readme.md
Created March 22, 2012 16:38 — forked from lucascaton/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@emaiax
emaiax / boot.rb
Created June 30, 2012 03:01 — forked from johanb/boot.rb
Spree extension files
require 'rubygems'
gemfile = File.expand_path("../../../../Gemfile", __FILE__)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
@emaiax
emaiax / 1. README.md
Created November 7, 2012 21:53 — forked from sauloarruda/1. README.md
Configurando aplicação Rails com Nginx e Unicorn

Configurando aplicação Rails com Nginx e Unicorn

TL;DR Como configurar uma aplicação Rails usando Nginx + Unicorn + Upstart + RVM (gemset por aplicação).

Dependências: (TODO) Configuração de Servidor Nginx

Essas instruções são aplicáveis para o seguinte ambiente:

  • Sistema Operacional: Ubuntu Server 12.04 beta2
  • Servidor: AWS EC2 usando ESB AMI: ubuntu/images-milestone/ebs/ubuntu-precise-12.04-beta2-amd64-server-20120328 (ami-b5ea34dc)
@emaiax
emaiax / README.md
Created November 7, 2012 21:53 — forked from sauloarruda/README.md
Criando novos usuários para acesso ao servidor

Criando novos usuários para acesso ao servidor

TL;DR Como criar usuário no servidor e como um cliente deve acessar esses servidores via ssh.

Essas instruções são aplicáveis para o seguinte ambiente:

  • Sistema Operacional: Ubuntu Server 12.04 beta2
  • Servidor: AWS EC2 usando ESB AMI: ubuntu/images-milestone/ebs/ubuntu-precise-12.04-beta2-amd64-server-20120328 (ami-b5ea34dc)

Porém, você pode usar as instruções e adaptá-las conforme sua necessidade para outras versões do ubuntu ou para outras distrbuições.

@emaiax
emaiax / carrierwave_tasks.rb
Created November 28, 2012 20:07 — forked from mrrooijen/carrierwave_tasks.rb
Rake Tasks for Carrier Wave for reprocessing versions.
##
# CarrierWave Amazon S3 File Reprocessor Rake Task
#
# Written (specifically) for:
# - CarrierWave
# - Ruby on Rails 3
# - Amazon S3
#
# Works with:
# - Any server of which you have write-permissions in the Rails.root/tmp directory
@emaiax
emaiax / gist:4741857
Created February 8, 2013 20:56
bootstrap-twitter-rails inside engine
$ rails g bootstrap:install
insert app/assets/javascripts/application.js
/Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails.rb:46:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/twitter-bootstrap-rails-2.2.1/lib/generators/bootstrap/install/install_generator.rb:75:in `use_coffeescript?'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/twitter-bootstrap-rails-2.2.1/lib/generators/bootstrap/install/install_generator.rb:35:in `add_bootstrap'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `each'
from /Users/emaiax/.rvm/gems/ruby-1.9.3-p194/gems/thor
@emaiax
emaiax / ranking.rb
Created October 15, 2014 18:13
Match Ranking
class Ranking
def initialize(list)
@list = list
end
def ranking
@list.map { |c| c.last.zero? ? 0 : 1 + c.last }.reduce(&:+)
end
def sort(lists)
Verifying I am +emaiax on my passcard. https://onename.com/emaiax
@emaiax
emaiax / codeclimate_vs_rubocop.md
Last active February 26, 2016 17:59
Code Climate CLI vs Rubocop

Code Climate CLI

.code-climate.yml

engines:
  fixme:
    enabled: true
  rubocop:
    enabled: true
  duplication: