Skip to content

Instantly share code, notes, and snippets.

View RomuloOliveira's full-sized avatar

Rômulo Oliveira RomuloOliveira

View GitHub Profile
@RomuloOliveira
RomuloOliveira / isort.cfg
Created September 1, 2017 17:31
Default settings for isort
[settings]
known_first_party=<first_party_app_name>
atomic=true
line_length=79
multi_line_output=3
skip=migrations
use_parentheses=true
not_skip = __init__.py
@RomuloOliveira
RomuloOliveira / deploy.sh
Last active November 28, 2017 11:21
Teresa deploy with git log description
$ git log --pretty=format:'%an: %h %s' -1 | xargs -t -o -I message teresa deploy . --app $APP --description '"message"'
teresa deploy . --app app --description "Rômulo Oliveira: 03394cf Bump version: 0.2.0 → 0.3.0"
@RomuloOliveira
RomuloOliveira / show_table_size.sql
Last active May 15, 2017 18:25
Show table size in MBs
# source: http://stackoverflow.com/a/9620273
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) as size
FROM information_schema.TABLES
WHERE table_schema = "$DB_NAME"
ORDER BY size DESC;
@RomuloOliveira
RomuloOliveira / postmortem.txt
Created May 12, 2017 17:19 — forked from renanivo/postmortem.txt
Template #postmortem
Produto: {produto}
Problema:
{O que aconteceu}
Linha do tempo e troubleshooting:
{data}:
@RomuloOliveira
RomuloOliveira / check_missing_migrations.sh
Last active June 12, 2017 14:48
Check for missing migrations
django/manage.py makemigrations --dry-run --noinput --settings=$(SETTINGS) | grep 'No changes detected' -q || (echo 'Missing migration detected!' && exit 1)
git branch --merged origin/master | grep -v master | grep -v '*' | xargs git branch -D
@RomuloOliveira
RomuloOliveira / uninstall_pip_dependencies.sh
Created July 7, 2016 13:23
uninstall all pip dependencies
pip freeze | xargs pip uninstall -y
@RomuloOliveira
RomuloOliveira / prepare_remote_branch.sh
Created July 8, 2015 16:28
Prepare a branch from another repository to merge into yours
# This assumes "origin" is your repo and "upstream" the other repo
git fetch upstream
git checkout upstream/<branch_name>
git checkout -b <your_branch_name>
git rebase master # or merge, if you prefer
git push --set-upstream origin <your_branch_name>
@RomuloOliveira
RomuloOliveira / remove_local_non_tracked_branches.sh
Created July 7, 2015 22:18
Remove branches no longer on remote
git fetch -p
git branch -vvv | grep gone | grep -v master | cut -f 3 -d " " # | xargs git branch -D
@RomuloOliveira
RomuloOliveira / .editorconfig
Last active August 9, 2017 16:20
default editor config
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space