Skip to content

Instantly share code, notes, and snippets.

View dbstephenson's full-sized avatar

Dave Stephenson dbstephenson

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@faisalman
faisalman / baseConverter.js
Last active January 11, 2023 14:43
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@bdougherty
bdougherty / gist:125113
Created June 7, 2009 02:32 — forked from xaviershay/gist:49265
Git branch status bash prompt
function get_git_branch {
git branch | awk '/^\*/ { print $2 }'
}
function get_git_dirty {
git diff --quiet || echo '*'
}
function get_git_prompt {
git branch &> /dev/null || return 1
echo "[$(get_git_branch)$(get_git_dirty)] "
}
function parse_git_dirty {
git diff --quiet || echo " *"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\w $(parse_git_branch)\$ '