Skip to content

Instantly share code, notes, and snippets.

View shammellee's full-sized avatar

Shammel Lee shammellee

View GitHub Profile
@shammellee
shammellee / tmux.conf
Created March 16, 2024 21:23 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@shammellee
shammellee / usps_track.sh
Created August 23, 2019 22:32
Track USPS packages
function usps_track()
{
local _USER_AGENT_CHROME_76='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'
local _URL="https://tools.usps.com/go/TrackConfirmAction?tLabels=${1}"
local _HEADER_USER_AGENT="User-Agent: ${_USER_AGENT_CHROME_76}"
curl --silent --location --header "$_HEADER_USER_AGENT" "$_URL" | pup 'h2 > strong text{}'
}
#! /usr/bin/env bash
function times()
{
_in_string="$1"
_out_string=""
_count=$2
for (( i=0; i < $_count; i++ ))
@shammellee
shammellee / mapfiles
Created September 29, 2016 10:07
rename files from a hash of file name mappings
#! /usr/bin/env bash
manifest=${1:-manifest}
[ ! -f "$manifest" ] && echo "no file \"${manifest}\"" && exit 1
while read line
do
from=${line%%:*}
to=${line##*:}