Skip to content

Instantly share code, notes, and snippets.

View abbasadel's full-sized avatar

Abbas Adel Ibraim abbasadel

View GitHub Profile
@abbasadel
abbasadel / git_global_hook_prepend_banch.sh
Last active June 26, 2017 11:10
Setup global git hook
#!/bin/sh
#create a folder to hold all global hooks
mkdir ~/.git-hooks
#download the hook that prepend branch name to the commit message
curl https://gist.githubusercontent.com/abbasadel/ff03536b35b36ce9953c6f6a879563e8/raw --output ~/.git-hooks/prepare-commit-msg
#make it executable
chmod +x ~/.git-hooks/prepare-commit-msg
@abbasadel
abbasadel / prepare-commit-msg
Created June 26, 2017 10:51
Git hook to prepend branch name to commit message
#!/bin/sh
## source .git/hooks/prepare-commit-msg.samlpe
BRANCH=`git branch | grep '^\*' | cut -b3-`
FILE=`cat "$1"`
echo "$BRANCH: $FILE" > "$1"
case "$2,$3" in
merge,)
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
@abbasadel
abbasadel / install.sh
Last active August 29, 2015 14:00 — forked from JeffreyWay/install.sh
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug