Skip to content

Instantly share code, notes, and snippets.

View RomuloOliveira's full-sized avatar

Rômulo Oliveira RomuloOliveira

View GitHub Profile
@RomuloOliveira
RomuloOliveira / multiple_ssh_setting.md
Last active July 5, 2024 20:20 — forked from jexchan/multiple_ssh_setting.md
Configure multiple git accounts on same computer using ssh

Multiple SSH Keys settings for different github account

Create different public key

Create different ssh key according the article Generating SSH keys.

Example:

@RomuloOliveira
RomuloOliveira / conditional_open.mk
Last active June 12, 2017 14:55
Conditional OS executable - Makefile
UNAME_S := $(shell uname -s)
# Note that this ifeq-endif are space-indented for better readability
ifeq ($(UNAME_S), Linux)
EXECUTABLE ?= linux_executable
endif
ifeq ($(UNAME_S), Darwin)
EXECUTABLE ?= osx_executable
endif
@RomuloOliveira
RomuloOliveira / export_django_settings.sh
Created March 6, 2015 14:01
Set Django settings environment variable
# set (--settings=settings.development)
export DJANGO_SETTINGS_MODULE=settings.development
# unset
unset DJANGO_SETTINGS_MODULE
@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
@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 / 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 / uninstall_pip_dependencies.sh
Created July 7, 2016 13:23
uninstall all pip dependencies
pip freeze | xargs pip uninstall -y
git branch --merged origin/master | grep -v master | grep -v '*' | xargs git branch -D
@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)
@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}: