Skip to content

Instantly share code, notes, and snippets.

View DavideViolante's full-sized avatar
🏠
Working from home

Davide Violante DavideViolante

🏠
Working from home
View GitHub Profile
// ==UserScript==
// @name HN target blank
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Open Hacker News links in a new tab
// @author Davide Violante
// @match https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
@DavideViolante
DavideViolante / .bashrc
Last active July 31, 2018 15:12
Show current git branch in Ubuntu bash
# Add these lines to your .bashrc file located in ~
# Tested on Ubuntu 18.04.1 LTS and git v2.17.1
# Show current git branch in terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(parse_git_branch) $ "