Skip to content

Instantly share code, notes, and snippets.

View edugon's full-sized avatar
🙃
¯\_(ツ)_/¯

eduu edugon

🙃
¯\_(ツ)_/¯
View GitHub Profile
@edugon
edugon / zsh_history_fix
Created May 2, 2020 13:20
Fix corrupt history file for zsh
#!/usr/bin/env zsh
# George Ornbo (shapeshed) http://shapeshed.com
# License - http://unlicense.org
#
# Fixes a corrupt .zsh_history file
mv ~/.zsh_history ~/.zsh_history_bad
strings ~/.zsh_history_bad > ~/.zsh_history
fc -R ~/.zsh_history
rm ~/.zsh_history_bad
@edugon
edugon / untracking_branches
Last active April 2, 2020 08:51
Aliases to show or delete local branches that are not tracking remote anymore.
# The commands will match "TD" pattern as branch name and "gone]" to check if branches are untracking.
# Note: Depending on language you have in your git client, "gone]" part may change to e.g. "desaparecido]".
# WARNING: In case the branch has "gone]" in some commit, prune command will also delete it.
# Same happens for unmerged branches, change it to "git branch -d" for a safer usage.
alias git_show_untracking="git branch -vv | awk '\$3~/TD/ && \$4~/gone]/ {print \$1}'"
alias git_prune_untracking="git branch -vv | awk '\$3~/TD/ && \$4~/gone]/ {print \$1}' | xargs -n1 git branch -D"
@edugon
edugon / postman-deb
Last active May 2, 2020 13:17 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
script=`basename "$0"`
if [ $# -gt 0 ] && [ "$1" = "-e" ]; then
e="-e"
fi
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)