Skip to content

Instantly share code, notes, and snippets.

View rodrigomanhaes's full-sized avatar

Rodrigo Manhães rodrigomanhaes

  • Campos dos Goytacazes, Rio de Janeiro, Brasil
View GitHub Profile
@rodrigomanhaes
rodrigomanhaes / .gitignore
Created March 10, 2012 16:04
Soluções para a lista 2 de orientação a objetos (Java)
bin
.classpath
.project
@rodrigomanhaes
rodrigomanhaes / nsicloudooo_usage.rb
Created March 23, 2012 21:23
How to use nsicloudooo gem
require 'nsicloudooo'
require 'base64'
oo = NSICloudooo::Client.new 'http://user:password@host:port'
filename = '/home/rodrigo/manual.odt'
f = File.open(filename)
doc = Base64.encode64(f.read)
response = oo.granulate(file: doc, filename: 'manual.odt')
key = response['key']
oo.done(key)
@rodrigomanhaes
rodrigomanhaes / capitulo1.rst
Created June 17, 2012 17:46
Resumo do livro Agile Estimating and Planning, de Mike Cohn

AGILE ESTIMATING AND PLANNING

Mike Cohn

CHAPTER 1. The Purpose of Planning

Plans help to guide investment decisions (this project is worth to begin?), know who needs to be available to work on a project during a given period and know if a project is on track.

require 'rails_helper'
feature 'select2' do
scenario 'select2', js: true do
5.times { create(:disciplina) }
visit new_disciplina_path
execute_script("$('.disciplina_pre_requisitos .select2-input').val('ABC')")
execute_script("$('.disciplina_pre_requisitos .select2-container').select2('open')")
wait_for_ajax
find('.select2-results li:first-child').click
@rodrigomanhaes
rodrigomanhaes / asset-pipeline-to-webpacker.md
Created January 14, 2019 17:58
Asset pipeline e webpack
@rodrigomanhaes
rodrigomanhaes / trilha-rails.markdown
Last active March 23, 2023 01:23
Trilha de estudos do desenvolvedor Rails
@rodrigomanhaes
rodrigomanhaes / audit_decorator.rb
Created March 17, 2019 23:13
Processing data from audited gem (only a draft)
module AuditDecorator
def changes_with_associations
klass = auditable.class
audited_changes.map do |attribute, (from, to)|
attribute = attribute.to_s
if attribute.ends_with?('_id')
results = from_to(attribute, from, to)
if results.present?
from, to = results
attribute = attribute[0..-4]