Skip to content

Commit

Permalink
Update all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenway committed Aug 26, 2020
1 parent 1044905 commit 639de6c
Show file tree
Hide file tree
Showing 9 changed files with 625 additions and 194 deletions.
21 changes: 9 additions & 12 deletions bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ sourcefile() {
done
}

pathprepend /usr/local/sbin
pathprepend /usr/local/opt/python@2/libexec/bin
pathprepend /opt/pkg/bin
pathprepend $HOME/.bin
pathprepend $HOME/.yarn/bin
pathprepend $HOME/.config/yarn/global/node_modules/.bin
Expand All @@ -45,8 +42,8 @@ sourcefile $HOME/.localrc
[[ -s "/opt/pkg/share/autojump/autojump.bash" ]] && . /opt/pkg/share/autojump/autojump.bash

## Git Flow Completion
source $HOME/.sysconfig/bash_completion.d/git-completion.bash
source $HOME/.sysconfig/bash_completion.d/git-flow-completion.bash
# source $HOME/.sysconfig/bash_completion.d/git-completion.bash
# source $HOME/.sysconfig/bash_completion.d/git-flow-completion.bash
export GH_LOGIN=stephenway

# Personal environment variables
Expand All @@ -55,13 +52,14 @@ export GH_LOGIN=stephenway
GIT_PS1_SHOWDIRTYSTATE=true
export COMMAND_MODE=unix2003;
export BROWSER=open;
export PKGIN_PREFIX="/opt/pkg";
export ZOPFLI="$PKGIN_PREFIX/bin/zopfli";
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

## Bash Git Prompt
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
GIT_PROMPT_ONLY_IN_REPO=1
GIT_PROMPT_ONLY_IN_REPO=0
GIT_PROMPT_THEME=Default_Ubuntu
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi

Expand All @@ -71,10 +69,6 @@ export VIM_BINARY="/usr/local/bin/vim";
export MVIM_BINARY="/usr/local/bin/mvim";
export VIMRC="$HOME/.vimrc";

## Node
export NODE_ENV="development";
export NODE_PATH="/usr/local/lib/node_modules";

## GPG Keys
export GPG_TTY=$(tty)

Expand All @@ -83,6 +77,7 @@ eval $(/usr/libexec/path_helper -s)
export PS1="\h \$ "

## NVM
export NODE_ENV="development";
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
Expand All @@ -91,6 +86,8 @@ if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use --silent
fi

export NODE_PATH=$NODE_PATH:`npm root -g`;

## iTerm Integration
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"

Expand Down
59 changes: 53 additions & 6 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~"
alias ..-="cd -"
alias la="ls -Al"

# Directories
Expand All @@ -39,6 +38,7 @@ alias wget-dir='wget -r --no-parent --reject "index.html*"'

# Git
alias g="git"
alias hotfix="HUSKY_SKIP_HOOKS=1 git commit -m"

# Vim
alias v="f -e vim" # quick opening files with vim
Expand All @@ -59,9 +59,6 @@ t() {

# NPM

# Use yarn when yarn.lock is detected
# alias npm=prioritize-yarn

n() {
if [[ $1 == "i" ]]; then
command npm install "$2"
Expand Down Expand Up @@ -106,8 +103,6 @@ alias nu="npm cache clean && npm update"
export ENV_IP="$(ipconfig getifaddr en0)"
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
alias flush="sudo killall -HUP mDNSResponder"
alias d.="desk ."


# Personal functions

Expand Down Expand Up @@ -137,3 +132,55 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

find-up () {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
echo "$path"
}

cdnvm(){
cd "$@";
nvm_path=$(find-up .nvmrc | tr -d '\n')

# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then

declare default_version;
default_version=$(nvm version default);

# If there is no default version, set it to `node`
# This will use the latest version on your machine
if [[ $default_version == "N/A" ]]; then
nvm alias default node;
default_version=$(nvm version default);
fi

# If the current version is not the default version, set it to use the default version
if [[ $(nvm current) != "$default_version" ]]; then
nvm use default;
fi

elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
declare nvm_version
nvm_version=$(<"$nvm_path"/.nvmrc)

declare locally_resolved_nvm_version
# `nvm ls` will check all locally-available versions
# If there are multiple matching versions, take the latest one
# Remove the `->` and `*` characters and spaces
# `locally_resolved_nvm_version` will be `N/A` if no local versions are found
locally_resolved_nvm_version=$(nvm ls --no-colors "$nvm_version" | tail -1 | tr -d '\->*' | tr -d '[:space:]')

# If it is not already installed, install it
# `nvm install` will implicitly use the newly-installed version
if [[ "$locally_resolved_nvm_version" == "N/A" ]]; then
nvm install "$nvm_version";
elif [[ $(nvm current) != "$locally_resolved_nvm_version" ]]; then
nvm use "$nvm_version";
fi
fi
}
alias cd='cdnvm'

1 change: 1 addition & 0 deletions brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ brew install bash-completion
# Install more recent versions of system tools
brew install curl
brew install git
brew install git-delta
brew install vim
brew tap maralla/pack
brew install pack
Expand Down
2 changes: 2 additions & 0 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@
gpgsign = true
[gpg]
program = /usr/local/bin/gpg
[pull]
rebase = false
1 change: 0 additions & 1 deletion gitignore_global
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ Thumbs.db
#######################
*.swp
*.swo
.vscode
*.code-workspace
15 changes: 3 additions & 12 deletions npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ set -e
# System Utilities
sudo npm install -g ghcal
sudo npm install -g nativefier
sudo npm install -g diff-so-fancy
sudo npm install -g speed-test
sudo npm install -g vtop
sudo npm install -g fkill-cli

sudo npm install -g ts-node
sudo npm install -g typescript
sudo npm install -g git-run

# Front-end
sudo npm install -g a11y
sudo npm install -g perfbudget
sudo npm install -g psi


# Package Management
sudo npm install -g bower
sudo npm install -g pakmanager
sudo npm install -g wipe-modules
sudo npm install -g install-peerdeps
Expand All @@ -27,28 +26,20 @@ sudo npm install -g lerna
sudo npm install -g npx
sudo npm install -g depcheck


# Syntax Checking
sudo npm install -g eslint
sudo npm install -g babel-eslint
sudo npm install -g eslint-plugin-react
# Auto-code formatting
sudo npm install -g js-beautify


# Image Optimization
sudo npm install -g imageoptim-cli
sudo npm install -g svgo


# Syntax Check
sudo npm install -g jsonlint
sudo npm install -g commitizen


# Regression Testing
sudo npm install -g slimerjs


# Web Extensions
sudo npm install -g web-ext
Loading

0 comments on commit 639de6c

Please sign in to comment.