Skip to content

Instantly share code, notes, and snippets.

View emaiax's full-sized avatar
🌵

Eduardo Maia emaiax

🌵
View GitHub Profile
@emaiax
emaiax / GPG and git on macOS.md
Created January 8, 2019 21:49 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
# OBI 2015 - Lápis de Cor
#
# Roberto tem um conjunto de lápis com 10 tons diferentes de uma mesma cor, numerados de 0 a 9.
# Numa folha de caderno quadriculado alguns quadrados foram coloridos inicialmente com o tom 0.
# Roberto precisa determinar, para cada quadrado Q não colorido, qual é a distância dele para o
# quadrado mais próximo de tom 0. A distância entre dois quadrados é definida com o número mínimo
# de movimentos ortogonais (para: esquerda, direita, cima, baixo) para ir de um quadrado para o outro.
# O quadrado Q, então, deve ser colorido com o tom cuja numeração corresponde à distância determinada.
# Se a distância for maior ou igual a 9, o quadrado deve ser colorido com o tom 9. Seu programa deve
# colorir e imprimir a folha quadriculada dada na entrada.
@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:
@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 / 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 / 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 / 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 / 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 / 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 / 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