Skip to content

Instantly share code, notes, and snippets.

View rafaelgotts's full-sized avatar

Rafael Gottsfritz rafaelgotts

  • Luizalabs
  • Sorocaba
View GitHub Profile
@rafaelgotts
rafaelgotts / git.txt
Created November 14, 2018 18:03
Git commands for weak memmories
git fetch -pt - makes git fetch all of your origins with two conditions:
-p - deletes all unnused branchs
-t - fetch all tags
git rebase origin/master - makes rebase from origin upstream, ignoring local one
@rafaelgotts
rafaelgotts / get_fingerprint.sh
Created March 14, 2018 13:11
Get fingerprint in MD5 from RSA pubkey
# If you need check if your key by fingerprint (eg.: github)
# you can run this command
KEY_PATH=<path_to_pub_key>
ssh-keygen -lf $KEY_PATH -E md5
@rafaelgotts
rafaelgotts / README.md
Created April 13, 2017 15:29
Install another python version from homebrew
@rafaelgotts
rafaelgotts / README.md
Created April 12, 2017 13:54
Restore a broken branch on brew

While trying to install a MSSQL client for terminal on Mac OSX, i found sqsh, but here starts my problems:

How sqsh don't have a brew formula, only two pull requests i think: Why not install trought git PR

After do this, i tried to use sqsh without success e giveup. But not uninstall then on that time.

Someday, when i try to update my brew problem on tap_migrations.json was showed.

Solving the problem

@rafaelgotts
rafaelgotts / pre-commit
Last active September 20, 2016 13:23
Pre-commit examples
# Check pep8 on all changed files
flake8 `git status -s | awk -F' ' '{print $2}'`
if [ ! $? -eq 0 ]; then
exit 1
fi
import os
SETTINGS_PATH = os.path.abspath(os.path.dirname(__file__))
PROJECT_PATH = os.path.join(SETTINGS_PATH, '..')
def print_path():
print(os.path.abspath(__file__))
print(os.path.abspath(os.path.dirname(__file__)))
@rafaelgotts
rafaelgotts / print_textos.py
Created July 16, 2015 17:40
Exemplo de decodes para windows usando python
# coding: utf-8
# print_textos.py
import sys
# Aqui eu converto do utf-8 para unicode e depois para latin1 ou cp850
# Se fizer direto, ele tentará usar a tabela ascii e dai...
texto = "Olá code page 1252!".decode("utf-8").encode('latin1')