Skip to content

Instantly share code, notes, and snippets.

Rodrigo R Aquino Rodrigora

Block or report user

Report or block Rodrigora

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
Rodrigora / request_macros.rb
Created Sep 19, 2015
Helper for requests specs with authenticity token
View request_macros.rb
module RequestMacros
def login_user(user = nil)
user = create(:user, password: 'password') unless user
# ensure password is valid when `user` is provided
expect(user.valid_password?('password')).to be(true)
# ensure user is confirmed
Rodrigora /
Last active Sep 14, 2015
Fish Shell config file with git branch and current RVM
set -g -x PATH /usr/local/bin $PATH
function fish_prompt --description 'Write out the prompt'
# Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
Rodrigora / Gemfile
Last active Sep 9, 2015 — forked from fnando/Gemfile
Running ActiveRecord specs
View Gemfile
source ''
gem 'rails', '4.2.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'bcrypt'
Rodrigora / commands
Created Mar 17, 2015
find and replace text in files recursively
View commands
# find text in files
grep -r "Text To Search" /path/to/search
# replace text in files
find . -name show.html.erb -exec sed -i "s/Text To Search/Text To Replace/g" {} \;
Rodrigora / minitest_assertions.rb
Created Feb 11, 2015
All Minitest Assertions
View minitest_assertions.rb
def assert test, msg = nil
def assert_empty obj, msg = nil
def assert_equal exp, act, msg = nil
def assert_in_delta exp, act, delta = 0.001, msg = nil
def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
def assert_includes collection, obj, msg = nil
def assert_instance_of cls, obj, msg = nil
def assert_kind_of cls, obj, msg = nil
def assert_match matcher, obj, msg = nil
def assert_nil obj, msg = nil
Rodrigora / add-support-to-array-to-emberjs-models
Last active Aug 29, 2015
add support to array attributes to EmberJS models
View add-support-to-array-to-emberjs-models
DS.ArrayTransform = DS.Transform.extend
deserialize: (serialized)->
if Ember.typeOf(serialized) == "array"
serialize: (deserialized)->
type = Ember.typeOf deserialized
if type is 'array'
View mask.js
// jQuery Masked Input
$('#celular').mask("(99) 9999-9999?9").ready(function(event) {
var target, phone, element;
target = (event.currentTarget) ? event.currentTarget : event.srcElement;
phone = target.value.replace(/\D/g, '');
element = $(target);
if(phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {
View git branch on prompt
parse_git_branch() {
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
You can’t perform that action at this time.