Skip to content

Instantly share code, notes, and snippets.

git config --global alias.last 'log -1 HEAD --stat'
git config --global alias.s 'status -s'
git config --global alias.scrub '!git reset --hard HEAD~10 && git pull'
git config --global alias.ls-alias 'config --get-regexp \"^alias\\.\"'
git config --global alias.ls-branch 'for-each-ref --sort=-committerdate refs/heads/ --format="%(committerdate:short) %(authorname) : %(refname:short) - %(contents:subject)"'
git config --global alias.last 'log -1 HEAD --stat'
git config --global alias.append 'commit --amend'
#!/bin/sh
#
# Run ctags after a commit
echo ""
echo "Ctags running ==============================="
echo ""
ctags -R .
@chrismarksus
chrismarksus / git_status_s
Created April 17, 2015 15:53
Git aliases
s = status -s
@chrismarksus
chrismarksus / git_commit_scoreboard.sh
Created April 17, 2015 15:47
git commit scoreboard
git log --format='%an' --no-merges ./ | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -rn | less
@chrismarksus
chrismarksus / gist:7d4257e81a8512492c98
Created April 17, 2015 15:44
bash function for getting the total commit for a user on a branch for a project
your_total_commits_on_branch_and_project() {
total=$(git log --author="$1" --pretty=oneline --no-merges | wc -l)
branch=$(git rev-parse --abbrev-ref HEAD)
project=$(git remote -v | head -n1 | sed -e 's/^[a-z]*.[http|ftp|ssh]*\:\/\/[a-Z]*\///' | sed -e 's/ ([fetch]*)//')
echo -e "\033[1;32m$1\033[0;32m has \033[1;32m$total\033[0;32m commits, on branch \033[1;32m$branch\033[0;32m, for project \033[1;32m$project\033[0m"
}
VERSION=${VERSION}
LOCAL=/path/to/ff/folder
FILE=firefox-{VERSION}.tar.bz2
#URL=ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/{VERSION}/linux-x86_64/en-US/{FILE}
URL=https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/{VERSION}/linux-x86_64/en-US/{FILE}
## change this
PATH=/path/to/browsers/{VERSION}/firefox/firefox-bin
cd {LOCAL}
wget {URL}
echo -e "\033[0mCOLOR_NC (No color)\n\033[1;37mCOLOR_WHITE\t\033[0;30mCOLOR_BLACK\n\033[0;34mCOLOR_BLUE\t\033[1;34mCOLOR_LIGHT_BLUE\n\033[0;32mCOLOR_GREEN\t\033[1;32mCOLOR_LIGHT_GREEN\n\033[0;36mCOLOR_CYAN\t\033[1;36mCOLOR_LIGHT_CYAN\n\033[0;31mCOLOR_RED\t\033[1;31mCOLOR_LIGHT_RED\n\033[0;35mCOLOR_PURPLE\t\033[1;35mCOLOR_LIGHT_PURPLE\n\033[0;33mCOLOR_YELLOW\t\033[1;33mCOLOR_LIGHT_YELLOW\n\033[1;30mCOLOR_GRAY\t\033[0;37mCOLOR_LIGHT_GRAY"
@chrismarksus
chrismarksus / create_merge_branch.sh
Created April 8, 2015 19:00
Create a merge branch and merge master to feature branch script
#!/bin/bash
LOCAL=$1
REMOTE=$2
MERGE=origin/master
echo -e "\n\e[1;37mCreate new merge branch \e[1;34m$LOCAL\e[1;37m from '\e[0;32m$REMOTE\e[0m'\n"
git checkout -b $LOCAL $REMOTE
# get local and remote hashes
@chrismarksus
chrismarksus / png_filename_to_uppercase
Created October 31, 2014 17:41
Convert png file name to uppercase
for f in *.png; do; mv "$f" "`tr [:lower:] [:upper:] <<< "${f%.*}"`.png"; done
@chrismarksus
chrismarksus / git_tags
Last active August 29, 2015 14:01
git commits between tags
git log tagA..tagB --pretty="%Cgreen%h%Creset %C(yellow)(%an)%Creset %s" --no-merges