Skip to content

Instantly share code, notes, and snippets.

@tmcgee123
tmcgee123 / showCurrentBranch
Last active February 9, 2016 15:23
This is to show the current Git branch that you are on while inside of Terminal.
#Found this here: http://martinfitzpatrick.name/article/add-git-branch-name-to-terminal-prompt-mac/
#Add this to your .bash_profile for Mac, haven't tested on Linux but it would go in .bashrrc there
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@tmcgee123
tmcgee123 / angularLockerPolyfill.js
Created October 21, 2015 21:14
This is a polyfill/fallback for angular-locker when the browser does not support webstorage.
(function (angular) {
'use strict';
/**
* @ngdoc overview
* @name angularLockerPolyfill
* @description Holds the decorator that overrides angular-locker
*/
angular.module('angularLockerPolyfill', [
'angular-locker'
@tmcgee123
tmcgee123 / clearGitBranches
Last active April 1, 2019 22:33
Clears the branches in current working directory that are not master, develop, or current checkout'd out branch
#!/bin/bash
#go to the current working directory
pwd |
while CWD= read -r line; do
cd "$line"
done
#designate local branches to skip
SKIPPEDBRANCHES="master develop"