Skip to content

Instantly share code, notes, and snippets.

@sauloefo
sauloefo / create-github-repo.sh
Created January 7, 2019 22:59
Create a GihHub repository from terminal
# %1 GitHub username
# %2 Repository name
# %3 Make repository private. User true or false
curl -u '%1' https://api.github.com/user/repos -d '{"name":"%2","private":"%3"}'
@sauloefo
sauloefo / change-committer.sh
Created January 2, 2019 21:10
Change the username and email of all commits that match the value of OLD_EMAIL var.
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="put old email here"
CORRECT_NAME="put new name here"
CORRECT_EMAIL="put new email here"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@sauloefo
sauloefo / .my-terminal-custom-settings
Last active November 24, 2019 13:03
My Terminal Customizations
# my-prompt-customizations
# 1. Setup my prompt
# 1.1. get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else