Skip to content
Open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
git/gitconfig.local.symlink
Brewfile.lock.json
secrets/
16 changes: 6 additions & 10 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cask_args appdir: '/Applications'

tap 'homebrew/bundle'
tap 'blendle/blendle'

brew 'cloudflared'
brew 'imagemagick'
Expand All @@ -13,22 +14,17 @@ brew 'stripe/stripe-cli/stripe'
brew 'stripe/stripe-mock/stripe-mock'
brew 'wget'
brew 'yt-dlp'
brew 'awscli'
brew 'kns'

cask '1password'
cask 'airtable'
cask 'android-platform-tools'
cask 'arq'
cask 'diffusionbee'
cask 'handbrake'
cask 'messenger'
cask 'notion-calendar'
cask 'plex'
cask 'sonos'
cask 'transmission'
cask 'raycast'
cask 'warp'
cask 'whatsapp'
cask 'visual-studio-code'
cask 'vlc'
cask 'zed'
cask 'zoom'

# work stuff
tap 'sendgrid-ops/workstation'
10 changes: 5 additions & 5 deletions bin/dot
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export ZSH=$HOME/.dotfiles

# Update dotfiles themselves
echo "› git pull"
git -C $ZSH pull
git -C $ZSHDOT pull

# Set macOS defaults
$ZSH/macos/set-defaults.sh
$ZSHDOT/macos/set-defaults.sh

# Set macOS hostname
$ZSH/macos/set-hostname.sh
$ZSHDOT/macos/set-hostname.sh

# Install homebrew
$ZSH/homebrew/install.sh 2>&1
$ZSHDOT/homebrew/install.sh 2>&1

# Upgrade homebrew
echo "› brew update"
Expand All @@ -62,4 +62,4 @@ brew upgrade

# Install software
echo "› script/install"
$ZSH/script/install
$ZSHDOT/script/install
4 changes: 2 additions & 2 deletions bin/set-defaults
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
#
# Sets macOS defaults by running $ZSH/macos/set-defaults.sh.
# Sets macOS defaults by running $ZSHDOT/macos/set-defaults.sh.

exec $ZSH/macos/set-defaults.sh
exec $ZSHDOT/macos/set-defaults.sh
75 changes: 75 additions & 0 deletions functions/goto
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# Go to a <repo> in ~/Code
#

goto() {
GO_DEFAULT=sendgrid

#
# The brains behind goto
#

nav() {
cd ~/Code/src/github.com/$1 &> /dev/null ||
clone $1 2> /dev/null ||
echo "repo @ $1 does not exist"
}

#
# Bash completion for goto()
#

_goto()
{
cur=${COMP_WORDS[COMP_CWORD]}
if [[ "$cur" =~ ^([^/]+)/(.+)$ ]]; then
use=`tree -f -L 1 ~/Code/src/github.com/ccnixon/ | grep ${BASH_REMATCH[2]} | tr / '\t' | awk '{print $(NF-1),$NF}' | tr ' ' /`
else
use=`ls ~/Code/src/github.com/$GO_DEFAULT/ | grep $cur`
fi
COMPREPLY=(`compgen -W "$use" -- $cur`)
}

if hash complete 2>/dev/null; then
complete -o default -o nospace -F _goto goto
fi

if hash shopt 2>/dev/null; then
shopt -s cdspell
fi

case $1 in

*/*)
nav $1
;;

*)
nav $GO_DEFAULT/$1
;;

esac

if hash shopt 2>/dev/null; then
shopt -s cdspell
fi

}

#
# Clone a <repo ...> by "owner/name" into ~/Code
#

clone() {
for repo in $@; do
if [[ "$repo" == */* ]]; then
local dir=$GOPATH/src/github.com/$repo
git clone ssh://git@github.com/$repo.git $dir
cd $dir
else
local dir=$GOPATH/src/github.com/$USER_DEFAULT/$repo
git clone ssh://git@github.com/$USER_DEFAULT/$repo.git $dir
cd $dir
fi
done
}
62 changes: 38 additions & 24 deletions git/gitconfig.symlink
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
# Local/private config goes in the include
[include]
path = ~/.gitconfig.local
path = ~/.gitconfig.local
[hub]
protocol = https
protocol = https
[alias]
co = checkout
promote = !$ZSH/bin/git-promote
wtf = !$ZSH/bin/git-wtf
rank-contributors = !$ZSH/bin/git-rank-contributors
count = !git shortlog -sn
[color]
diff = auto
status = auto
branch = auto
ui = true
co = checkout
promote = !$ZSHDOT/bin/git-promote
wtf = !$ZSHDOT/bin/git-wtf
rank-contributors = !$ZSHDOT/bin/git-rank-contributors
count = !git shortlog -sn
pushd = push -u origin HEAD
open = "!f(){ open https://github.$(git config remote.origin.url | cut -f2 -d. | tr ':' /); }; f"
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
excludesfile = ~/.gitignore
editor = vim
excludesfile = ~/.gitignore
editor = vim
pager = delta --line-numbers
[delta]
side-by-side = true
[apply]
whitespace = nowarn
whitespace = nowarn
[mergetool]
keepBackup = false
keepBackup = false
[difftool]
prompt = false
prompt = false
[help]
autocorrect = 1
autocorrect = 1
[push]
# See `git help config` (search for push.default)
# for more information on different options of the below setting.
#
# Setting to git 2.0 default to suppress warning message
default = simple
# See `git help config` (search for push.default)
# for more information on different options of the below setting.
#
# Setting to git 2.0 default to suppress warning message
default = simple
[credential]
helper = osxkeychain
[diff "spaceman-diff"]
command = /opt/homebrew/bin/spaceman-diff

[init]
defaultBranch = main
[url "ssh://git@github.com/sendgrid"]
insteadOf = https://github.com/sendgrid
[url "git@github.com:"]
insteadOf = https://github.com/
1 change: 1 addition & 0 deletions git/gitignore.symlink
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*~
*.swp
.vscode/*
3 changes: 3 additions & 0 deletions go/config.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export GOPATH=~/Code
export GOPRIVATE=github.com/sendgrid/*,github.com/sendgrid-ops/*,code.hq.twilio.com/*
export GOBIN=$GOPATH/bin
1 change: 1 addition & 0 deletions go/path.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$PATH:$GOPATH/bin
14 changes: 10 additions & 4 deletions ruby/gemrc.symlink
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- https://rubygems.org/
- https://gems.sendgrid.net
:update_sources: true
:verbose: true
:backtrace: false
:benchmark: false
gem: --no-document
install: "--user --no-document"
update: "--user --no-document"
benchmark: false
gem: "--no-document"
5 changes: 5 additions & 0 deletions ruby/rbenv.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ if (( $+commands[rbenv] ))
then
eval "$(rbenv init -)"
fi

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
export PATH=/opt/homebrew/opt/ruby/bin:$PATH
export PATH=`gem environment gemdir`/bin:$PATH
fi
1 change: 1 addition & 0 deletions sendgrid/exports.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export BOOTSTRAP_SCRIPT_DIR=/Users/cnixon/Code/src/github.com/sendgrid/sg-workstation/scripts
2 changes: 1 addition & 1 deletion system/_path.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export PATH="./bin:/usr/local/bin:/usr/local/sbin:$ZSH/bin:$PATH"
export PATH="./bin:/usr/local/bin:/usr/local/sbin:$ZSHDOT/bin:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
2 changes: 2 additions & 0 deletions zsh/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
alias reload!='. ~/.zshrc'

alias cls='clear' # Good 'ol Clear Screen command

alias dotfiles='code ~/.dotfiles' # Open dotfiles
4 changes: 2 additions & 2 deletions zsh/config.zsh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export LSCOLORS="exfxcxdxbxegedabagacad"
export CLICOLOR=true

fpath=($ZSH/functions $fpath)
fpath=($ZSHDOT/functions $fpath)

autoload -U $ZSH/functions/*(:t)
autoload -U $ZSHDOT/functions/*(:t)

HISTFILE=~/.zsh_history
HISTSIZE=10000
Expand Down
2 changes: 1 addition & 1 deletion zsh/fpath.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#add each topic folder to fpath so that they can add functions and completion scripts
for topic_folder ($ZSH/*) if [ -d $topic_folder ]; then fpath=($topic_folder $fpath); fi;
for topic_folder ($ZSHDOT/*) if [ -d $topic_folder ]; then fpath=($topic_folder $fpath); fi;
77 changes: 0 additions & 77 deletions zsh/prompt.zsh

This file was deleted.

Loading