Skip to content

Instantly share code, notes, and snippets.

View Hosein-NZF's full-sized avatar
👩‍💻

Hosein Hosein-NZF

👩‍💻
  • Iran
View GitHub Profile
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Custom bash prompt via kirsle.net/wizards/ps1.html
export PS1="\[$(tput setaf 6)\]\u\[$(tput setaf 7)\]@\[$(tput setaf 2)\]\h\[$(tput sgr0)\]\[$(tput setaf 7)\]:\[$(tput sgr0)\]\[$(tput setaf 5)\]\W\[$(tput sgr0)\]\[$(tput bold)\]\[$(tput setaf 3)\]\$(parse_git_branch)\[$(tput sgr0)\]\[$(tput setaf 7)\] \\$ \[$(tput sgr0)\]"
var myElement = document.getElementById('IDoftheDIV');
if(window.addEventListener) {
// Normal browsers
myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
} else
if(window.attachEvent) {
// IE
myElement.attachEvent('DOMSubtreeModified', contentChanged);
}