Skip to content

Instantly share code, notes, and snippets.

[alias]
branches = "!f(){ git reflog | egrep -io \"moving from ([^[:space:]]+)\" | awk '{ print $3 }' | awk ' !x[$0]++' | egrep -v '^[a-f0-9]{40}$' | head; }; f"
copy = "!f(){ git rev-parse --abbrev-ref HEAD | tr -d '\n' | pbcopy; }; f"
delete-merged = "!f(){ git fetch --all; git checkout origin/develop; git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d; }; f"
forgot = commit -a --amend -C HEAD
history = for-each-ref --sort=-committerdate refs/heads/ --count=20 --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
last = log -1 HEAD
load = "!f(){ git checkout $1; git reset --soft HEAD~; git unstage .; }; f"
merge-last = "!f() { last_branch=$(git rev-parse --abbrev-ref @{-1} | tr -d '\n'); echo $last_branch; git merge --no-ff $last_branch; }; f"
rank = shortlog -sn --no-merges
@JoshuaSoileau
JoshuaSoileau / branch-name.js
Last active November 15, 2017 14:14
Parses out a new feature branch name for you, as long as you are viewing a jira task
// Parses out a new feature branch name for you, as long as you are viewing a jira task
// Create a new Bookmark, and use the code below as the URL (name can be anything)
javascript:(function(){String.prototype.replaceAll=function(search,replacement){var target=this;return target.replace(new RegExp(search,'g'),replacement)};var fullTitle=document.getElementById('summary-val').textContent.toLowerCase(),taskNumber=document.getElementById('key-val').textContent,titleArray=fullTitle.split('|').map(function(ele){return ele.trim()}),taskName=titleArray.pop().replaceAll(' ','-'),affectedTheme=titleArray.join('-').replaceAll(' ','-');var site=null;prompt('Copy to clipboard: Ctrl+C, Enter', 'feature/'+taskNumber+'__'+affectedTheme+'__'+taskName);}());
@JoshuaSoileau
JoshuaSoileau / lp-switcher.js
Created November 8, 2017 18:48
JS bookmarklet to swap out landing page instances
// Create a new Bookmark, and use the code below as the URL (name can be anything)
javascript:(function(){window.location = window.location.href.split('?')[0] + '?lp=' + prompt('Enter a Landing Page #');}());
@JoshuaSoileau
JoshuaSoileau / gist:8af781a2b522bd5f0653
Last active December 7, 2015 15:41
Command Line Alias to Open AtTask
attask() {
x-www-browser https://blueacorn.attask-ondemand.com/task/view?ID=$1
}
## For OSX:
#attask() {
# /usr/bin/open -a "/Applications/Google Chrome.app" 'https://blueacorn.attask-ondemand.com/task/view?ID='$1
#}