Skip to content

Instantly share code, notes, and snippets.

View salhernandez's full-sized avatar
🦈

Salvador Hernandez salhernandez

🦈
View GitHub Profile
#!/bin/bash
function get_branch() {
git branch --no-color | grep -E '^\*' | awk '{print $2}' \
|| echo “default_value”
}
branch_to_merge="master"
current_branch=$(get_branch)
timestamp=$(date +%m-%d-%Y_%H-%M-%S)
@salhernandez
salhernandez / notifyMe.sh
Created August 28, 2019 05:41
Shell wrapper that sends push notification via Pushover when a task is completed.
#!/bin/bash
# Invoke it by .... sh notifyMe generateJs
# This is meant for tasks that require more than a few seconds to execute. Upon completion the push notification via Pushover will be sent.
# Can be used for compiling an Android .apk from React-Native, etc...
listDirectory="listDirectory"
buildAndroid="buildAndroid"
if [ $1 = $command1 ]; then
ls
@salhernandez
salhernandez / InstallingMeld.md
Last active May 9, 2024 04:49 — forked from kjlubick/InstallingMeld
How to install Meld on Windows and getting it set up with Git

Install Meld from their webpage http://meldmerge.org/

I had to tell git where it was:

git config --global merge.tool meld git config --global diff.tool meld

If using windows 8 and 10 use the following git config --global mergetool.meld.path "/c/Program Files (x86)/meld/meld.exe" git config --global difftool.meld.path "/c/Program Files (x86)/meld/meld.exe"

@salhernandez
salhernandez / prepare-commit-msg
Last active December 29, 2017 06:30 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
#change what you want to grab from the branch