Skip to content

Instantly share code, notes, and snippets.

View matthewkturner's full-sized avatar

Matthew K. Turner matthewkturner

View GitHub Profile
function gg() {
local grep="$1"
until [ -z "$3" ]
do
shift
grep+=" $1"
done
local path=$2
@matthewkturner
matthewkturner / gitFunc.sh
Last active March 30, 2019 03:25
opening a GitHub issue
view_github_issue() {
open -a Google\ Chrome https://github.com/$github_org/$github_repo/issues/$1
}
alias issue=view_github_issue
@matthewkturner
matthewkturner / gitFunc.sh
Last active March 30, 2019 02:52
open pull request
github_org='narvar'
github_repo=${PWD##*/}
git_branch() {
local git_status="$(git status 2> /dev/null)"
local on_branch="On branch ([^${IFS}]*)"
local on_commit="HEAD detached at ([^${IFS}]*)"
if [[ $git_status =~ $on_branch ]]; then
local branch=${BASH_REMATCH[1]}