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 / steps
Last active May 30, 2019
setting up CTags for mac/sublime
View steps
Install JSON support
brew install jansson
Install Universal CTGAS
brew install --with-jansson --HEAD universal-ctags/universal-ctags/universal-ctags
Install CTAGS sublime plugin
Generate tags
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 /
Created Feb 8, 2019 — forked from turicas/
Get stock prices from BMF Bovespa API
# coding: utf-8
# Copyright 2015 Álvaro Justen <>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
kill -9 $(ps aux | grep spring | awk '{print $2}' | head -n 1)
kill -9 $(ps aux | grep webkit | awk '{print $2}' | head -n 1)
# Find files and remote by pattern
find /path/to/directory -type f -name '*[0-9]x[0-9]*[0-9]x[0-9]*.jpg' -delete
Rodrigora /
Last active Oct 19, 2018
Useful VI commands for git
# - VI replace pick -> fixup
# replace " x x x" -> ""
Rodrigora / delete_branches.rb
Created Jun 13, 2018
Ruby script to delete git branches
View delete_branches.rb
def delete_branches
pattern = /CT-\d{4}/
result = `git branch`
branches = result.split("\n").map(&:strip)
branches.each do |branch|
if branch =~ pattern
puts `git branch -d #{branch}`
Rodrigora / camelSnake.js
Created May 27, 2018 — forked from simongong/camelSnake.js
JavaScript: convert format of object keys between camel-case and snake-case
View camelSnake.js
* @param {Object|String} data string or keys of object are named in form of snake
* @param {number} depth to which level of keys should it process
* @return {Object|String} string or keys of object are named in form of camel case
exports.snakeToCamel = function(data, depth) {
if (Util.isObject(data)) {
if (typeof depth === 'undefined') {
depth = 1;
Rodrigora / auth_helpers.rb
Created May 27, 2018 — forked from blaze182/auth_helpers.rb
Request specs devise_token_auth Authentication helpers
View auth_helpers.rb
# spec/support/requests/auth_helpers.rb
module Requests
module AuthHelpers
module Extensions
def sign_in(user)
let(:auth_helpers_auth_token) {
View iterm2-profile.json
"Use Non-ASCII Font" : false,
"Tags" : [
"Ansi 12 Color" : {
"Red Component" : 0.4405802488327026,
"Color Space" : "Calibrated",
"Blue Component" : 0.5168579816818237,
"Alpha Component" : 1,
Rodrigora /
Last active Mar 27, 2017
Replace string in files
# finds all files in app folder with .rb extension
# for each file
# capitalizes every "cr" strings preceded by a non-letter and followed by a capital letter
find app -name '*.rb' -exec sed -i '' -- "s/\([^a-zA-Z]\)[Cc][Rr]\([A-Z]\)/\1CR\2/g" {} +
# rename PGIntegrationError -> CRProviderError
find app -name '*.rb' -exec sed -i '' -- "s/PGIntegrationError\CRProviderError/g" {} +
find app spec config lib -name '*.rb' -exec sed -i '' -- "s/pg_integration_error\?\cr_provider_error\?/g" {} +
You can’t perform that action at this time.