Skip to content

Instantly share code, notes, and snippets.

Rodrigo Machado rcmachado

  • Loadsmart
  • Rio de Janeiro, Brazil
Block or report user

Report or block rcmachado

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
rcmachado /
Last active Mar 1, 2019 — forked from eduardocardoso/
Generating a JWT token
from __future__ import absolute_import
# To run:
# $ pip install pyjwt
# $ python
import jwt

Keybase proof

I hereby claim:

  • I am rcmachado on github.
  • I am rcmachado ( on keybase.
  • I have a public key whose fingerprint is 778C 615C C641 8517 3318 F0F5 02B6 97FD CCAF B437

To claim this, I am signing this object:

rcmachado / Makefile
Last active Aug 23, 2019
Add a help target to a Makefile that will allow all targets to be self documenting
View Makefile
.PHONY: help
# Based on
## This help screen
printf "Available targets\n\n"
awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
rcmachado /
Last active Aug 29, 2015
Install my boxen
# Install & configure boxen
sudo mkdir -p /opt/boxen
sudo chown ${USER}:staff /opt/boxen
git clone ${BOXEN_REPOSITORY} /opt/boxen/repo
cd /opt/boxen/repo
rcmachado /
Last active Aug 29, 2015
Script to copy all tables from one database to another.
# Script to copy all tables from one database to another.
# Requires:
# * MySQL 5.6
# * Percona xtrabackup tools (
# Known caveats:
# * Will copy structure of all tables from one database to another, but only InnoDB
View Symfony1Storage.php
use \OAuth\Common\Token\TokenInterface;
use \OAuth\Common\Storage\Exception\TokenNotFoundException;
use \OAuth\Common\Storage\Exception\AuthorizationStateNotFoundException;
use \OAuth\Common\Storage\TokenStorageInterface;
use \sfStorage;
class Symfony1Storage implements TokenStorageInterface
rcmachado / remove_hover_rule.js
Created Nov 4, 2013
Remove CSS :hover rules for touch devices to avoid iOS double-tap behavior. Copied and adapted from (just a fix for sheet.cssRules)
View remove_hover_rule.js
// disable :hover on touch devices
// based on
// via
// +
// re
// NOTE: we should use .no-touch class on CSS
// instead of relying on this JS code
function removeHoverCSSRule() {
if ('createTouch' in document) {
try {
rcmachado / error_reporting.php
Last active Jul 8, 2017
Script to verify PHP error_reporting settings. Adapted from
View error_reporting.php
$errorLevel = error_reporting();
print "Current error_reporting level: $errorLevel <br>\n";
print "E_ALL value: " . E_ALL . " <br>\n";
for ($i = 0; $i < 15; $i++) {
$errVal = $errLevel & pow(2, $i);
print FriendlyErrorType($errVal) . " ($errVal) <br>\n";
rcmachado /
Created Mar 28, 2013
How to install most recent git using homebrew
# install brew if not installed
which brew > /dev/null || ruby -e "$(curl -fsSL"
# update brew package list
brew update
# install git from brew
[[ -x /usr/local/bin/git ]] || brew install git
# if git is installed, upgrade it
rcmachado / logger.js
Created Feb 5, 2013
Javascript "class" (Logger) to use in MongoDB scripts. This class prints the messages (respecting log level specified on constructor).
View logger.js
* Logger class to print messages according to specified level.
* Usage:
* var log = new Logger(Logger.INFO);
*"Show message");
function Logger(level) {
this.level = level || Logger.DEBUG;
You can’t perform that action at this time.