Skip to content

Instantly share code, notes, and snippets.

View seasick's full-sized avatar
💭
Advertisment space for sale

Clemens seasick

💭
Advertisment space for sale
View GitHub Profile
@seasick
seasick / gist:9f0f95896d100cfdf29199281d7b0fa1
Last active October 10, 2023 06:20
My Bash Git coloring for ~/.bashrc
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
get_git_stash_count() {
git rev-list --walk-reflogs --count refs/stash 2> /dev/null | sed 's/\(.*\)/{\1}/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;33m\]$(parse_git_branch)\[\033[0;31m\]$(get_git_stash_count)\[\033[00m\]\$ '
@seasick
seasick / select2.bookmarklet.js
Last active April 19, 2016 03:52 — forked from hawkrives/select2.bookmarklet.js
Bookmarklet to turn <select>s into <select²>s
javascript:void%20function(){function%20e(e,n){var%20o=document.createElement(%22script%22);o.onload=function(){console.log(e+%22%20loaded%22),n()},o.onerror=function(o){console.log(e+%22%20errored%22,o),n(o)},o.src=e,document.body.appendChild(o)}function%20n(e,n){c.link=document.createElement(%22link%22),c.link.onload=function(){n()},c.link.onerror=function(e){n(e)},c.link.href=e,c.link.rel=%22stylesheet%22,c.link.type=%22text/css%22,document.body.appendChild(c.link)}function%20o(n){return%20window.jquery||window.$%3Fn():void%20e(c.jquery,n)}function%20t(){n(c.css,function(n){return%20n%3Fconsole.log(%22err%20loading%20css%22,n):void%20o(function(n){return%20n%3Fconsole.log(%22err%20loading%20jquery%22,n):void%20e(c.js,function(e){if(e)return%20console.log(%22err%20loading%20select2%20js%22,e);var%20n=[].slice.call(document.querySelectorAll(%22select%22));n.forEach(function(e){jQuery(e).select2({dropdownAutoWidth:!0})})})})})}var%20c={js:%22https://cdn.rawgit.com/select2/select2/3.5.4/select2.min.js%22,css:%