Skip to content

Instantly share code, notes, and snippets.

Siegfried Bilstein sbilstein

Block or report user

Report or block sbilstein

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sbilstein
sbilstein / getTimeEmoji.sh
Last active Jul 19, 2018
Get an emoji for the time of day!
View getTimeEmoji.sh
#!/bin/bash
function get_time
{
local hour="`date +%H`"
local emoji="a"
if [ $hour -lt 10 -a $hour -gt 6 ]; then
emoji="🌅"
elif [ $hour -lt 15 ]; then
emoji="☀️"
elif [ $hour -lt 20 ]; then
View git-remaster.sh
#!/bin/sh
branch=`git branch | grep \* | cut -d ' ' -f2`
if [ $branch = 'master' ]; then
echo "Can't remaster on master" >&2
exit 1
fi
ref=`git rev-parse $branch`
echo "To restore your branch ($branch), run the following:"
@sbilstein
sbilstein / bash_prompt
Last active Dec 31, 2015
BASH prompt with git branch name and status. Fixed to handle directory names with spaces and checks to see if nested directories are under source control.
View bash_prompt
#!/bin/bash
# BASH prompt builder
#
# This is a script I use to generate BASH prompts that look like this:
# (master)*
# [sbilstei@sbilstei-mn1:~/localcode/git-sandbox]:$
#
# Basically user, the machine's hostname, current working directory tilde condensed and an optional branch name
# when navigating a git repo. The asterisk is visible if there are uncommitted changes.
View .gitconfig
[credential]
helper = osxkeychain
[core]
excludesfile = ~/.gitexcludes
[branch]
autosetuprebase = always
[alias]
rem = rebase origin/master
co = checkout
br = branch
View gist:8792434
grep 'some shit' | cut -f2 -d:
@sbilstein
sbilstein / gist:8698161
Created Jan 29, 2014
remove padding with sed
View gist:8698161
sed -e 's/^\s*//' -e '/^$/d'
You can’t perform that action at this time.