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FKAS5UTAC 5BU7HOAEIRC3FQHV2QP4KXSO7B3EPJ3FTR57RVMJ2HZN4ERGKHKAC 4DKZCHE3SKQ5Y5R3Q2LU6UAB55UPUZ5RFKHP26SZXZ4EKGOYITWAC if test `uname` = "Darwin"; thenalias copy=pbcopyalias paste=pbpaste# open finder in $PWDalias finder="open -a Finder ."# change directories into the directory of top most finder windowalias cdfinder="cd `osascript < $DOTFILES/applescripts/finder_cwd.applescript`"function preview {# open a file in the default macOS previewqlmanage -p "$@" &> /dev/null}function trash {# put a file in the macOS default trash foldercommand mv "$@" ~/.Trash}function toggle_desktop_icons {enable="false"case `defaults read com.apple.finder CreateDesktop 2> /dev/null` in0) enable="true";;1) enable="false";;*)esacdefaults write \com.apple.finder \CreateDesktop -bool $enable \&& killall Finder}function toggle_autocorrect_mode {enable="false"case `defaults read -g NSAutomaticSpellingCorrectionEnabled 2> /dev/null` in0) enable="true";;1) enable="false";;esacdefaults write -g NSAutomaticSpellingCorrectionEnabled -bool $enable}function toggle_system_ui_keyboard_behavior {# 0 is default, 3 enables things like tab in system dialogs# https://github.com/herrbischoff/awesome-macos-command-line#full-keyboard-accessvalue=0case `defaults read NSGlobalDomain AppleKeyboardUIMode 2> /dev/null` in0) value=3;;3) value=0;;*) value=0;;esacdefaults write NSGlobalDomain AppleKeyboardUIMode -int $value}elsewhich xsel &> /dev/null && \alias copy='xsel --clipboard --input' && \alias paste='xsel --clipboard --output'# prefer xclip if installedwhich xclip &> /dev/null && \alias copy='xclip -selection clipboard' && \alias paste='xclip -selection clipboard -o'fi
alias cp='cp -iv' # verbose and warningalias mv='mv -iv' # verbose and warningalias mkdir='mkdir -pv' # verbpose and make path
if [ -f $1 ] ; thencase $1 in*.tar.bz2) tar xjf $1 ;;*.tar.gz) tar xzf $1 ;;*.bz2) bunzip2 $1 ;;*.rar) unrar e $1 ;;*.gz) gunzip $1 ;;*.tar) tar xf $1 ;;*.tbz2) tar xjf $1 ;;*.tgz) tar xzf $1 ;;*.zip) unzip $1 ;;*.Z) uncompress $1 ;;*.7z) 7z x $1 ;;*) echo "'$1' cannot be extracted via extract()" ;;esacelseecho "'$1' is not a valid file"fi
MY_ZSH_FUNCTIONS=$DOTFILES/zsh/functionsfpath=($MY_ZSH_FUNCTIONS $fpath)for func in $(ls $MY_ZSH_FUNCTIONS); do autoload $func; done;
my_funcs=$DOTFILES/zsh/functionsfpath=($my_funcs $fpath)for func in $(ls $my_funcs); do autoload $func; done;
#! /bin/bashstderr_log=/tmp/install_important_packages_errors.logstdout_log=/tmp/install_important_packages.logfunction _trim {# remove blank lines, leading and trailing whitespacesed '/^$/d' | sed -e 's/^ *//' | sed -e 's/ *$//'}function _filter_known_ok {# filter out log messages known to be ok_trim < $1 | \grep -v "brew upgrade " | \grep -v "already installed" | \egrep -iv "re-?install" | \egrep -v "info: (latest)|(downloading)|(installing)|(default)"}function install_everything {#################### install homebrew###################which brew &> /dev/null || \/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"# NOTE: don't try to be smart with OS, let brew decide what it can and can't install#################### install packages###################echo -n 'coreutilscurlfdfishfzfgolastpass-climoreutilsmyclineovimnoderipgrepsdthe_silver_searchertmuxwgetzsh' | _trim | xargs brew install#################### install gui apps###################echo -n 'firefoxfluxflycutspectacle' | _trim | xargs brew cask install################################## install apps from special taps#################################brew list | grep -q emacs-plus || \(brew tap d12frosted/emacs-plus && brew install emacs-plus)##################### install oh-my-zsh####################test -d $HOME/.oh-my-zsh || \sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"##################### install spacemacs####################emacs_d=$HOME/.emacs.dtest -d $emacs_d || \git clone https://github.com/syl20bnr/spacemacs $emacs_d####################################### install vim-plug for vim and neovim######################################vim_plug_file=$HOME/.vim/autoload/plug.vimtest -f $vim_plug_file || \curl -fLo $vim_plug_file --create-dirs \https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimnvim_plug_file=$HOME/.local/share/nvim/site/autoload/plug.vimtest -f $nvim_plug_file || \curl -fLo $nvim_plug_file --create-dirs \https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim################# install pyenv################test -d $HOME/.pyenv || \curl https://pyenv.run | bash################## install rustup#################which rustup &> /dev/null || \curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y}function on_success {if test $(_filter_known_ok $stderr_log | wc -l) -eq 0; thenecho "Install completed without error."rm $stderr_logrm $stdout_logreturn 0elseecho "Install completed but errors were logged."echo "See full stderr at $stderr_log"echo "See full stdout at $stdout_log"return 1fi}function on_error {echo "Install did not complete or partially completed with unhandled error."echo "See full stderr at $stderr_log"echo "See full stdout at $stdout_log"return 2}# you can redirect stderr like this if you want to more easily debug:# 2> >(tee -a $stderr_log >&2)install_everything \> $stdout_log \2> $stderr_log \&& on_success \|| on_error
# swift repl fix - due to brew python being at the front of $PATH variablealias swift="PATH=/usr/bin:$PATH swift"# enable excercism cli bash completionif [ -f ~/.config/exercism/exercism_completion.bash ]; thensource ~/.config/exercism/exercism_completion.bashfi
# sets up the terminal to make working on a project easyworkon () {project=$1case $project in"eventbrite"*)cd $EBPATH;;"fastfile"*)cd /Users/ccummings/eventbrite_github/triage_projects/jira_modal;;"data_nerds"*)cd /Users/ccummings/mistahchris_github/data_nerds/pyenv activate data_nerds;;"tableau_help"*)cd /Users/ccummings/tableau_helpsource ./private/config_vars.shsource ./.profile.d/000-react-app-exports.sh;;esac}
}# pullall iterates through each immediate child directory, if it's a git repo# switches to master branch, runs: git pull# switches back to whatever branch it was originallypullall () {dir=`pwd`echo "Begin pulling new master branch code for every child repo..."echo "..."for REPO in `ls -l | grep ^d | grep -oE '[^ ]+$'`;doecho "----------------------------"echo ""command -p cd "$REPO";if [ -d ".git" ]; thencbranch=`parseBranch`if [ $cbranch != "master" ]; thencommand git checkout "master"fiecho "pulling master branch of: $REPO ..."command git pullif [ $cbranch != "master" ]; thencommand -p cd "$cbranch"fificommand -p cd $dirdone;
fi}update_brew_shit() {brew outdated | fzf -m -n 1 --tac --header='Select formulae to upgrade with tab' | xargs brew upgrade}rgvim () {FZF_SELECTION=$( rg -Fi "$*" | fzf -0 -1 --ansi)if [ ! -z "$FZF_SELECTION" ]thenvim "+/$*" $( echo "$FZF_SELECTION" | awk 'BEGIN { FS=":" } { printf "%s\n", $1 }' )
lastpass() {CLIPBOARD_CONTENTS=`pbpaste``lpass show -cp $@ -G` # set the lpass cli result to clipboard$(_sleep_then_restore_clipboard $CLIPBOARD_CONTENTS) &}####################### Eventbrite FUNCTIONS######################alias ebpresto="presto --server http://presto.prod.dataf.eb:8080 --user ccummings"ebpresto_csv () {`presto --server http://presto.prod.dataf.eb:8080 --user ccummings --file $1 --output-format CSV_HEADER > query_result.csv`}waiting-room-qa() {eid=$1if [ "$eid" -eq "$eid" ] 2>/dev/null; thenwhile true ; do curl http://evbqa.com/queue_rpc/get/$eid; doneelseecho "Try again with a valid Eventbrite Event ID"fi}
tell application "Finder"tryset curr_dir to (folder of the front window as alias)on errorset curr_dir to (path to desktop folder as alias)end tryPOSIX path of curr_dirend tell
bind -n M-down select-pane -D# nova color schemeset -g pane-border-style 'bg=black,fg=#1E272C'set -g pane-active-border-style 'bg=black,fg=#1E272C'set -g status-style 'bg=#1E272C,fg=#6A7D89'set-window-option -g window-status-current-bg '#1E272C'set-window-option -g window-status-current-fg cyanset -wg mode-style 'bg=cyan,fg=black'set -g message-style 'bg=black,fg=cyan'set -g clock-mode-colour cyan
bind -n M-down select-pane -D