Skip to content

Instantly share code, notes, and snippets.

View sbilstein's full-sized avatar

Siggy Bilstein sbilstein

View GitHub Profile
hello world
// ==UserScript==
// @name Check for PrimeNow Delivery
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author cumby
// @match https://primenow.amazon.com/checkout/*
// @grant none
// ==/UserScript==
@sbilstein
sbilstein / getTimeEmoji.sh
Last active July 19, 2018 17:43
Get an emoji for the time of day!
#!/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
#!/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 / .gitconfig
Last active August 29, 2015 14:01
.gitconfig
[credential]
helper = osxkeychain
[core]
excludesfile = ~/.gitexcludes
[branch]
autosetuprebase = always
[alias]
rem = rebase origin/master
co = checkout
br = branch
@sbilstein
sbilstein / gist:8792434
Created February 3, 2014 21:08
only line numbers
grep 'some shit' | cut -f2 -d:
@sbilstein
sbilstein / gist:8698161
Created January 29, 2014 22:08
remove padding with sed
sed -e 's/^\s*//' -e '/^$/d'
@sbilstein
sbilstein / bash_prompt
Last active December 31, 2015 11:59
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.
#!/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.