Skip to content

Instantly share code, notes, and snippets.

View ivanbogomoloff's full-sized avatar

ivan ivanbogomoloff

View GitHub Profile
export PS1=\[\033[1;37m\]\w(\D{%T})\[\033[33m\]$(gb)\[\033[00m\]$
@ivanbogomoloff
ivanbogomoloff / gist:a4e9a092fc36befc6321bc8a65bf049c
Created October 23, 2018 20:56
git and hg branch in prompt PS1
# .bashrc
# ~/.bashrc file
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
@ivanbogomoloff
ivanbogomoloff / gist:d659d8d286719a83c811a84aaa9194d0
Created October 25, 2018 09:46
i3wm selected interactive screenshot with scrot to clipboard
i3-msg exec "scrot -s selected_area_screen.png && cat selected_area_screen.png | xclip -selection clipboard -t image/png -i"
@ivanbogomoloff
ivanbogomoloff / commit-msg
Created February 19, 2019 09:11
Automatically adds branch name and branch description to every commit message.
#!/bin/sh
# Place it to .git/hooks/commit-msg and chmod +x .git/hooks/commit-msg
# Automatically adds branch name and branch description to every commit message.
#
NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)
echo "$NAME"'/'$(cat "$1") > "$1"
if [ -n "$DESCRIPTION" ]
then
@ivanbogomoloff
ivanbogomoloff / bashrc
Created February 19, 2019 09:13
Append to PS1 info about current version control system and branch name
# .bashrc
#
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=