Skip to content

Instantly share code, notes, and snippets.


Luiz Picolo ツ luizpicolo

Block or report user

Report or block luizpicolo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .railsrc
# .railsrc
-B #Skip Bundle
-T #Skip Test-Unit
-d postgresql #Use postgres
luizpicolo / Exercicios5
Last active Aug 11, 2018 — forked from lrlucena/Exercicios5
Lista de Exercícios 5 da disciplina de Programação de Computadores
View Exercicios5
#encoding: utf-8
# Escreva um programa que leia um número e mostre se ele é igual a 10.
puts "Digite um número: "
x = gets.to_i
if x==10 then
puts "O valor digitado foi 10."
puts "O valor digitado não foi 10."
luizpicolo / app.rb
Last active Jul 16, 2018 — forked from hendrikswan/app.rb
sample sinatra mongodb service
View app.rb
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
class Price
include Mongoid::Document
luizpicolo /
Created Jul 17, 2017 — forked from tomas-stefano/
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above


cribbed from

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.


# Namespace for classes and modules that handle serving documentation over HTTP
luizpicolo / model_extension.rb
Created Jan 4, 2017 — forked from brenes/model_extension.rb
Removing validation of a model declared on a gem
View model_extension.rb
# We have to remove validations on email, as it's no longer needed.
# Based on a solution found at
Model.class_eval do
_validators.reject!{ |key, _| key == :field }
_validate_callbacks.each do |callback|
callback.raw_filter.attributes.delete :field
luizpicolo / sign-pdf.rb
Created Dec 20, 2016 — forked from matiaskorhonen/sign-pdf.rb
Quick and dirty PDF signing in Ruby (using Origami)
View sign-pdf.rb
#!/usr/bin/env ruby
require "openssl"
require "time"
require "origami"
rescue LoadError
abort "origami not installed: gem install origami"
luizpicolo /
Created Dec 6, 2016 — forked from blackjk3/
Creating a gem project with rspec

** Create the plugin without test-unit and specify the path for the dummy application:

rails plugin new $project_name --skip-test-unit --dummy-path=spec/dummy --mountable

** Add rspec-rails as a development dependency to the gemspec file (foobar.gemspec): do |s|
luizpicolo /
Created Oct 13, 2016 — forked from wdullaer/
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp:// --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb docker main > /etc/apt/sources.list.d/docker.list"

RailsAdmin and Globalize3

I have a project where I need translated content. Therefore I use globalize3, wich stores its translated attributes in a seperate table that belongs to the original model. And I use RailsAdmin for painless record management.

It took me some time to figure out how to get those working together, but eventually I found a solution that is non invasive and still ok to work with.

The translated model

In my case there is a Snippet class. It holds content for static pages or text passages on the website. There is a good README for globalize3 for installation instructions and documentation.

You can’t perform that action at this time.