Skip to content

Instantly share code, notes, and snippets.

View MauricioRobayo's full-sized avatar

Mauricio Robayo MauricioRobayo

View GitHub Profile
@MauricioRobayo
MauricioRobayo / crwf.sh
Last active May 9, 2020 03:46
Microverse code review workflow on steroids
cr_wf () {
user="$(echo $1 | sed 's|https://github.com/\([^/]*\)/\([^/]*\)/pull.*$|\1|')"
repo="$(echo $1 | sed 's|https://github.com/\([^/]*\)/\([^/]*\)/pull.*$|\2|')"
pull="$(echo $1 | sed 's|https://github.com/.*/pull/\([0-9]\+\).*$|\1|')"
workspace="/tmp/mv-tse-cr-${user}/${repo}"
api_pr="https://api.github.com/repos/${user}/${repo}/pulls/${pull}')"
branch="$(curl -s -H 'Accept: application/vnd.github.v3+json' "${api_pr}" | jq --raw-output '.head.ref')"
echo "USER=${user}"
echo "REPO=${repo}"
echo "PULL=${pull}"
@MauricioRobayo
MauricioRobayo / speedmp3.sh
Last active March 18, 2020 16:09
YouTube to mp3 command line script
check_commands() {
local ok=0
for command in "$@";do
if ! command -v "${command}" >/dev/null 2>&1;then
echo "'${command}' is not installed!"
ok=1
fi
done
return "${ok}"
}