Skip to content

Instantly share code, notes, and snippets.

Rodrigo Fernandes rtfpessoa

Block or report user

Report or block rtfpessoa

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
@rtfpessoa
rtfpessoa / .config
Last active Aug 11, 2019 — forked from sit/gitproxy-socat
Wrappers around socat and netcat to use git behind a proxy
View .config
# Use netcat to proxy git ssh through a proxy.
# Useful if you are trying to clone ssh:// from inside a company.
#
# Save this file as `~/.ssh/config`
#
# See http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/ for Emil Sit's original HTTP proxy script.
# See http://www.jones.ec/blogs/a/entry/using_git_through_a_socks/ for updated SOCKS version.
#
ProxyCommand nc -x 10.0.0.84:1986 %h %p
View keybase.md

Keybase proof

I hereby claim:

  • I am rtfpessoa on github.
  • I am rtfpessoa (https://keybase.io/rtfpessoa) on keybase.
  • I have a public key ASA4htimtW6SmHp6UKNUcAXTZk7TKbvdYhnIBLrL6m1b0Qo

To claim this, I am signing this object:

@rtfpessoa
rtfpessoa / AppDelegate.m
Last active Mar 19, 2016
React native automatic server ip generation
View AppDelegate.m
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
@rtfpessoa
rtfpessoa / handle-ctrl-c.py
Created Mar 19, 2016
Handle CTRL+C in Python
View handle-ctrl-c.py
#!/usr/bin/env python
import signal
import sys
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
@rtfpessoa
rtfpessoa / private.xml
Last active Mar 19, 2016
Karabiner Keybins
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Media Keys Always</name>
<identifier>Media-Keys-Always</identifier>
<!-- Volume Up -->
<!--
<autogen>
__KeyToKey__
KeyCode::PAGEUP, ModifierFlag::FN, ConsumerKeyCode::VOLUME_UP
@rtfpessoa
rtfpessoa / cgd.py
Created Mar 16, 2016 — forked from brunomlopes/cgd.py
Simple api to fetch accounts, balances and transactions from Caixa Geral de Depósitos's ( CGD ) API used by their Windows 8 application.
View cgd.py
# gist: https://gist.github.com/4397792
# Usage:
# session = cgd.CgdSession(uid, password)
# session.login()
# session.load_latest_transactions(account_key)
# 'session.known_accounts' is now populated with the initial accounts taken from the login response,
# and the data for the 'account_key' account.
# session.load_latest_transactions(account_key) loads the latest transactions and balances for a given account.
@rtfpessoa
rtfpessoa / linux-monitor.sh
Last active Mar 3, 2016
Linux Monitor Tools
View linux-monitor.sh
#!/bin/bash
#
# Linux Server Profiling tools (cpu, memory, io, etc)
#
sudo apt-get -y install htop iotop sysstat
htop
View 2f-two-factor-timer.js
var updateTimer = function(period, updateTokenCallback) {
// Get current time seconds
var epocSecs = Math.floor((+new Date()) / 1000);
var sec = epocSecs % period;
var secsToNext = 0;
// Fire if clock has struck 0 or 'period'
if (sec == 0 || sec == period) {
updateTokenCallback();
@rtfpessoa
rtfpessoa / postgresql-blockers-waiters.sql
Created Feb 18, 2016
Postgresql Blockers and Waiters
View postgresql-blockers-waiters.sql
SELECT blocked_locks.pid AS blocked_pid,
blocked_activity.usename AS blocked_user,
blocking_locks.pid AS blocking_pid,
blocking_activity.usename AS blocking_user,
blocked_activity.query AS blocked_statement,
blocking_activity.query AS blocking_statement
FROM pg_catalog.pg_locks blocked_locks
JOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid
JOIN pg_catalog.pg_locks blocking_locks
ON blocking_locks.locktype = blocked_locks.locktype
@rtfpessoa
rtfpessoa / ImplicitStackOverflow.scala
Last active Feb 9, 2016
Scala Implicit StackOverflow
View ImplicitStackOverflow.scala
case class ModelObject(foo1: String, foo2: String, foo3: String, foo4: String, foo5: String)
case class ApiObject(bar1: String, bar3: String, bar4: String)
object ModelObject {
implicit def toApi(m: ModelObject): ApiObject = {
ApiObject(m.foo1, m.foo3, m.bar1)
}
}
ModelObject.toApi(ModelObject("1","2","3","4","5")) // bar1 ?? what ?? StackOverflow
You can’t perform that action at this time.