Skip to content

Instantly share code, notes, and snippets.

View chris-peterson's full-sized avatar

Chris Peterson chris-peterson

View GitHub Profile

How I Use Git

This is not meant to be prescriptive, this is just how I use git. Sharing in case others find it useful.

Branch Early

Shift mindset to branch early.

About to do something (even something small)?

@chris-peterson
chris-peterson / git-web
Last active August 9, 2022 18:57
quickly jump from terminal to web ui
if git rev-parse --is-inside-work-tree 2>/dev/null; then
open "https://$(echo $(git remote get-url origin | sed 's/git@//' | sed 's/\.git//' | sed 's/:/\//'))"
else
echo "'$PWD' is not a git repo"
fi > /dev/null
watch -n 1 "ps aux | grep -i 'zoom\.us' | grep -v grep > /dev/null && echo 'zoom is running' || echo 'zoom is NOT running'"
@chris-peterson
chris-peterson / .zshrc
Created September 23, 2021 17:36
My ZSH config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/cpeterson/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@chris-peterson
chris-peterson / cwd
Created March 31, 2022 19:40
get working directory for arbitrary PID
lsof -a -p <PID> -d cwd -F n | grep '^n' | sed 's/^n//'
@chris-peterson
chris-peterson / readme.md
Created July 31, 2022 02:18
server config
graph
    subgraph offsite
        bb[(backblaze.com)]
        db[(dropbox.com)]
    end
    subgraph home server
        hsnd{{shared network drive}}
        hsst(syncthing)
 hsem(emby)
@chris-peterson
chris-peterson / 0-README.md
Last active October 13, 2022 00:11
openaudible-rename

Overview

OpenAudible is great for taking control over your audible library.

A missing feature (in their backlog) is to customize output filenames. This gist is a script to support different filename formats.