Skip to content

Instantly share code, notes, and snippets.

View qwinters's full-sized avatar

Quinn Winters qwinters

View GitHub Profile
@qwinters
qwinters / better-brew.zsh
Created January 23, 2022 12:55
Better integration for homebrew for Mac
# Add brew sbin to path
[[ $PATH != *"/usr/local/sbin"* ]] && export PATH=/usr/local/sbin:$PATH
# Wrapper for brew to execute brewfile dumping on certain brew commands
function brew () {
local dump_commands=("install" "uninstall" "tap" "untap")
local main_command="${1}"
local brewfile_path="~/.config/brewfile/Brewfile"
command brew ${@}
@qwinters
qwinters / better-zplug
Created January 19, 2022 09:55
Tools for making it easier to work with zplug
function zplug-reinstall-all() {
curdir=$(PWD)
cd $ZPLUG_REPOS
rm -rf *
cd $curdir
zplug install
}
function reload() {
source ~/.zshrc
@qwinters
qwinters / de-en-keyboard.keylayout
Created July 20, 2021 00:26
German American Hybrid Keyboard
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Created by Ukelele version 343 on 2021-06-18 at 12:28 (PDT)-->
<!--Last edited by Ukelele version 343 on 2021-06-18 at 13:01 (PDT)-->
<keyboard group="126" id="-29488" name="German / English" maxout="1">
<layouts>
<layout first="0" last="17" mapSet="ANSI" modifiers="Modifiers"/>
<layout first="18" last="18" mapSet="JIS" modifiers="Modifiers"/>
<layout first="21" last="23" mapSet="JIS" modifiers="Modifiers"/>
<layout first="30" last="30" mapSet="JIS" modifiers="Modifiers"/>
@qwinters
qwinters / better-ghq.zsh
Last active June 2, 2021 21:33
GHQ that auto-saves repos to ~/.ghqrepos
function better_ghq() {
ghq $@
{ ghq list ; cat ~/.ghqrepos } | sort | uniq -u > ~/.ghqrepos
}
alias Ghq="\\ghq"
alias ghq=better_ghq
@qwinters
qwinters / better-youtubedl.zsh
Last active January 13, 2022 13:46
Youtube DL Aliases
alias yt-dl="yt-dlp -N 4 --restrict-filenames"
alias yt-video="yt-dlp -N 4 --restrict-filenames --no-playlist"
alias yt-playlist="yt-dlp -N 4 --restrict-filenames --yes-playlist"
alias yt-music="yt-dlp -N 4 --restrict-filenames --yes-playlist --extract-audio"
@qwinters
qwinters / better-iso8601.zsh
Created June 2, 2021 20:51
Aliases for ISO-8601 functions
alias isoTime='date +"%H:%M:%SZ"'
alias isoTimestamp='date +"%Y-%m-%dT%H:%M:%SZ"'
alias isoDate='date +"%Y-%m-%d"'
@qwinters
qwinters / better-history.zsh
Created June 2, 2021 20:43
Better History Settings
export HISTFILE=~/.zsh_history
export HISTSIZE=10000000
export SAVEHIST=10000000
HIST_STAMPS="%Y-%m-%d% %T"
setopt EXTENDED_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
@qwinters
qwinters / better-defaults-macos.md
Last active February 21, 2022 11:51
Better ZSH/cli defaults for MacOS

Requirements

If you are uncertain if you have the requirements, run this script:

brew install ack bat coreutils dateutils exa fzf neovim npm rsync trash \
  && npm install --global gtop
@qwinters
qwinters / better-piping.zsh
Last active June 2, 2021 20:45
ZSH Piping Aliases
# One letter shortcuts
alias -g C="| pbcopy "
alias -g D="| tr -d "
alias -g G="| grep -i "
alias -g H="| head "
alias -g Q="> /dev/null 2>&1 "
alias -g R="| tr "
alias -g S="| sort "
alias -g T="| tail "
alias -g U="| uniq -c "