From 87f676e29fe23f91dc8c1bfe9ed3ee2ea4e91297 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:32:08 -0500 Subject: [PATCH 01/10] remove shit --- custom/example.zsh | 10 ---------- custom/plugins/example/example.plugin.zsh | 2 -- custom/themes/example.zsh-theme | 4 ---- 3 files changed, 16 deletions(-) delete mode 100644 custom/example.zsh delete mode 100644 custom/plugins/example/example.plugin.zsh delete mode 100644 custom/themes/example.zsh-theme diff --git a/custom/example.zsh b/custom/example.zsh deleted file mode 100644 index c505a9673..000000000 --- a/custom/example.zsh +++ /dev/null @@ -1,10 +0,0 @@ -# You can put files here to add functionality separated per file, which -# will be ignored by git. -# Files on the custom/ directory will be automatically loaded by the init -# script, in alphabetical order. - -# For example: add yourself some shortcuts to projects you often work on. -# -# brainstormr=~/Projects/development/planetargon/brainstormr -# cd $brainstormr -# diff --git a/custom/plugins/example/example.plugin.zsh b/custom/plugins/example/example.plugin.zsh deleted file mode 100644 index 406f27445..000000000 --- a/custom/plugins/example/example.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme deleted file mode 100644 index ef8f1c630..000000000 --- a/custom/themes/example.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -# Put your custom themes in this folder. -# Example: - -PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " From 93d04724a76f7b18017d6db95ad443c6a49f964a Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:36:46 -0500 Subject: [PATCH 02/10] Add my custom --- .gitignore | 4 +- custom/aliases.zsh | 20 +++++++ custom/exports.zsh | 4 ++ custom/functions.zsh | 88 ++++++++++++++++++++++++++++++ custom/plugins.zsh | 14 +++++ custom/plugins/zsh-auto-nvm-use | 1 + custom/plugins/zsh-autosuggestions | 1 + custom/secrets.zsh | 16 ++++++ custom/sources.zsh | 1 + custom/zshrc.zsh | 18 ++++++ 10 files changed, 164 insertions(+), 3 deletions(-) create mode 100755 custom/aliases.zsh create mode 100755 custom/exports.zsh create mode 100755 custom/functions.zsh create mode 100755 custom/plugins.zsh create mode 160000 custom/plugins/zsh-auto-nvm-use create mode 160000 custom/plugins/zsh-autosuggestions create mode 100755 custom/secrets.zsh create mode 100755 custom/sources.zsh create mode 100755 custom/zshrc.zsh diff --git a/.gitignore b/.gitignore index 71ae444e5..50f6877cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -# custom files -custom/ # temp files directories cache/ @@ -8,4 +6,4 @@ log/ .DS_Store # editor configs -.vscode \ No newline at end of file +.vscode diff --git a/custom/aliases.zsh b/custom/aliases.zsh new file mode 100755 index 000000000..d0860eeef --- /dev/null +++ b/custom/aliases.zsh @@ -0,0 +1,20 @@ + +#API ALIASES +alias dapi='~/Projects/denim-api'; +alias activate='source ~/Projects/denim-api/.denim-api/bin/activate'; + +#FRONT-END ALIASES +alias dfe='~/Projects/denim-app'; +alias dcw='celery worker --config=app.data.celeryconfig'; +alias dfw='flower --port=5555 --config=app.data.celeryconfig'; +alias dar='python run.py'; +alias dapidev='rabbitmq-server; dcw && dfw && dar'; + +#MAC ALIASES +alias virtualenv3='~/Library/Python/3.5/bin/virtualenv'; + +alias gffs='git flow feature start' +alias gfff='git flow feature finish `git branch | sed -En "s/\* feature\/(.*)/\1/p"`; ggp' +alias ggl="git for-each-ref --sort=-committerdate refs/heads/ --format='%1B[38;5;010m%(authorname)%1B[m: [%1B[0;31m%(refname:short)%1B[m] %1B[38;5;201m%(subject)%1B[m'" + +alias ls='ls -G' diff --git a/custom/exports.zsh b/custom/exports.zsh new file mode 100755 index 000000000..9e1b68e63 --- /dev/null +++ b/custom/exports.zsh @@ -0,0 +1,4 @@ +export ZSH=$HOME/.oh-my-zsh +export PATH=$HOME/bin:/usr/local/bin:$PATH +export PATH="/usr/local/opt/python/libexec/bin:$PATH" +export ZSH_THEME="dallas" \ No newline at end of file diff --git a/custom/functions.zsh b/custom/functions.zsh new file mode 100755 index 000000000..b10d86315 --- /dev/null +++ b/custom/functions.zsh @@ -0,0 +1,88 @@ +ggp () { + if [[ "$#" != 0 ]] && [[ "$#" != 1 ]] + then + git push origin "${*}" + else + [[ "$#" == 0 ]] && local b="$(git_current_branch)" + git push origin "${b:=$1}" + fi +} + +function killPort(){ + lsof -i tcp:$1 | awk '{print $2}' | grep -v 'PID' | xargs kill +} + +killPort2 () { + lsof -i tcp:$1 | awk '{print $2}' | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} -v 'PID' | xargs kill -9 +} + +reset_zsh(){ + source ~/Projects/zsh-custom/init.zsh +} + +function gitUpstream() { + CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" + git checkout master + git fetch upstream + git rebase upstream/master + git push origin master + git checkout "${CURRENT_BRANCH}" +} + +function gitPullRequest() { + local remote=${2:-origin} + git fetch ${remote} +refs/pull/$1/head:refs/remotes/${remote}/pr/$1 + git pull --no-rebase --squash ${remote} pull/$1/head +} + +function gitPullRequestUpstream() { + git reset --hard + gitUpstream + local remote=${2:-upstream} + git fetch ${remote} +refs/pull/$1/head:refs/remotes/${remote}/pr/$1 + git pull --no-rebase --squash ${remote} pull/$1/head +} + +function yarnVersion() { + echo "Uninstalling yarn..." + rm -f /usr/local/bin/yarnpkg + rm -f /usr/local/bin/yarn + + echo "Removing yarn cache..." + if [ -z ${YARN_CACHE_FOLDER+x} ]; then + rm -rf ${YARN_CACHE_FOLDER} + else + rm -rf ${HOME}/.yarn + fi + + echo "Installing yarn..." + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $1 +} + +function findDepsRecrusivly(){ + cd ~/Projects + grep --include=\package.json -rnw '.' -e $1 +} + +function backupDb(){ +# host=denimsocial-beta.c5gy6o8ang2y.us-east-1.rds.amazonaws.com +# user=admin +# pass=28KBEKpwcgMQTEfd8wbvDeWN + ssh ci.denimsocial.com 'mysqldump --opt denimsocial_beta -h denimsocial-beta.c5gy6o8ang2y.us-east-1.rds.amazonaws.com --user admin -p' | gzip | aws s3 cp - s3://social-dump/beta.sql.gz +} + + +# grab master and update it. +# fetch all branches +# delete all branches merged into master +# grab develop and update it +# delete all branches merged into develop +function git_clean_local(){ + git checkout master && git pull origin master && git fetch -p && git branch -d $(git branch --merged | grep master -v); + git checkout develop && git pull origin develop && git fetch -p && git branch -d $(git branch --merged | grep develop -v); +} + +# show local branches and when they were created +function git_branch_history(){ + for k in $(git branch | sed s/^..//); do echo -e $(git log --color=always -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k --)\\t"$k";done | sort +} \ No newline at end of file diff --git a/custom/plugins.zsh b/custom/plugins.zsh new file mode 100755 index 000000000..bf96e1b2b --- /dev/null +++ b/custom/plugins.zsh @@ -0,0 +1,14 @@ +PLUGINS_DIR=$ZSH/plugins +source $PLUGINS_DIR/git/git.plugin.zsh +source $PLUGINS_DIR/z/z.plugin.zsh + +if [ ! -d "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then +# Take action if $DIR exists. # +echo "Installing zsh autosuggestions..." + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions +else + source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +fi + + +eval "$(gh completion -s zsh)" diff --git a/custom/plugins/zsh-auto-nvm-use b/custom/plugins/zsh-auto-nvm-use new file mode 160000 index 000000000..539ad85cc --- /dev/null +++ b/custom/plugins/zsh-auto-nvm-use @@ -0,0 +1 @@ +Subproject commit 539ad85cc5bd7bb9d2ee940390678760459f75c2 diff --git a/custom/plugins/zsh-autosuggestions b/custom/plugins/zsh-autosuggestions new file mode 160000 index 000000000..ae315ded4 --- /dev/null +++ b/custom/plugins/zsh-autosuggestions @@ -0,0 +1 @@ +Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d diff --git a/custom/secrets.zsh b/custom/secrets.zsh new file mode 100755 index 000000000..b53937a7d --- /dev/null +++ b/custom/secrets.zsh @@ -0,0 +1,16 @@ + +export GOOGLE_MAPS_KEY='AIzaSyC_amaqk2zvjFaxRQsNe1RlQsd2LQDHQvU' +export MAIL_PASS='duvrtRuWdnKgkf4GEe[LBwcHTBEc' +export MAIL_FROM='noreply@denimlabs.com' +export CSE_API_KEY='AIzaSyAGtVgkxshncV0d2r0J5EaeO-IzGuAoZoY' +export CSE_ID='011491340340727568483:21aexljjiig' +export FB_ADMIN_TOKEN='EAASqT3VilxUBAJS9VUWGzZCZBOQ516rmJk7TaHaSP5oGDTLzNxw8qnt5DU4EhyyL4ctscpDI7TQ176XHx18EteB17dqDOVydgxRNjd98XmmJEx04oVZCaLooI2Qscexfs8JzNWnjpZAgjW5mxq1QNM4ZAtu4on3LXUhOgp1QZCN8k8gByyjgrW' +export FB_ADMIN_APPSECRET_PROOF='b5c4f527ec33457e9e9923e81096a75e4ca3823d56e0c82b8467298108cc11f3' +export FB_BUSINESS_ID='1704512749835563' +export FB_APP_SECRET='6e6f5facf2dcbe12c5f114574d8264d0' +export NPM_TOKEN="532aedef-30f6-4f7c-9786-24a7585c23d1" +export ATLAS_API_KEY='3g2r5lMiT2cV9iDv9yHfnoVmHK0RHaGdzO6D5AUcF8n79QvqZN3y364l0dwtkMyx' +# export AWS_ACCESS_KEY_ID="ASIA3E4CFGJKJ2SRH2WV" +# export AWS_SECRET_ACCESS_KEY="NQKMB3dsFYa91PiwAvZ9BGiJ4cRIo+fg/8Tn8zpm" +# export AWS_SESSION_TOKEN="IQoJb3JpZ2luX2VjEH8aCXVzLWVhc3QtMSJHMEUCIFeikgdYda0HQIinUnWk4Jcqy+tPYZFDPUFU9XOUov61AiEA91MDuu3WLrS6buo4lUheZUExrgC/WzVYDzhPFp5YK8gqjQMI2P//////////ARAAGgw3NjYzODc3NjE3NDgiDPI94QCWZmuBx27M5CrhAjpVBPM+QwWB0HIuD7RWxYwULtXgFoJasC8k1AEVkKl/zJnnPtuDybvU3MkisbQ3JxFz22GRhdRECug12cB8xGXRZqAcy1/adYRLO+fRCYj3NyKih7uN2U9ZeZ9XkaQwEn/3YG0rqpaGSFlFknnyOyN7fnTKkMX8mdGdBZr1VTxSbzadnLwfpF+Rl05wiUpoyKus7kwDYkMg1tkXao2TUWQLf/lu1JEatd5L5UlejtiQAekepKi72PRcfK61HjYIEQiXhTFCz8hDUVcrUtgqKiOnSwyfm/J8SFzZkpnyA5rPj+kqORDasySuymZ7HB6Th6TvKPsgeYZYg+wtRJy3/fjlADRNmEVkpiHPUH32lYy3jkkU2Ln7YnD5bpHuG8AvT4Zj/xs+uyO/zdXBI6ypNWxudS7Zi74sleO4kAT/40XsLmNKK8y+5tTtPXOOfUd66CT4cXgX3KUAE4FC9On0Gk2UMITAoooGOqYBj/2ltKS/4adcL2uFOKnaCVpq2uYzNVibQ7iEbzIBKU5psWX7GU/fty1Ur3BFTty2k/OrbtL6Aiyd/Q416Zw7E9IqxcbFvwXY8FV5IaS2XOBBfoIsqTIt3uuj2tUKsYDYiGOmH1grpRnTQ26TKjnBPI/MzgTqONdFbSCgOlOb+jSomFTPdEE7sVLtskxaCGbe0feiGIjlAgFN7BN+IHaJ8tD/2XNF8A==" +export PUBLISHING_BETA_DB_PASS='oJExzjttPKjLFGvc,3KY' \ No newline at end of file diff --git a/custom/sources.zsh b/custom/sources.zsh new file mode 100755 index 000000000..8b1378917 --- /dev/null +++ b/custom/sources.zsh @@ -0,0 +1 @@ + diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh new file mode 100755 index 000000000..be027b826 --- /dev/null +++ b/custom/zshrc.zsh @@ -0,0 +1,18 @@ +# source ~/Projects/zsh-custom/init.zsh +# backup for new installs..zshrc should be light +# export ZSH=$HOME/.oh-my-zsh +# export ZSH_CUSTOM=/Users/michaelwclark/Projects/zsh-custom/ +# export ZSH_THEME="dallas" +# source $ZSH/oh-my-zsh.sh +export NVM_DIR="$HOME/.nvm" + [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm + [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion + + + +# Sync changes +git pull +git add . +git commit -m "update" +git push mine master + From 2c5a06e3645b94930f8bede8fef0d562962b415c Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:41:03 -0500 Subject: [PATCH 03/10] update --- custom/zshrc.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index be027b826..afd1f218d 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -16,3 +16,5 @@ git add . git commit -m "update" git push mine master +bindkey "^[[1;3C" forward-word +bindkey "^[[1;3D" backward-word From 77d1fe907b9d290b8ed3c279396ff862769c7809 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:48:20 -0500 Subject: [PATCH 04/10] update --- custom/zshrc.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index afd1f218d..339446180 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -11,10 +11,15 @@ export NVM_DIR="$HOME/.nvm" # Sync changes +THIS_CWD=`cwd` +cd ~/.oh-my-zsh git pull git add . git commit -m "update" git push mine master +cd $THIS_CWD -bindkey "^[[1;3C" forward-word -bindkey "^[[1;3D" backward-word +bindkey "\e[1;3D" backward-word # ⌥← +bindkey "\e[1;3C" forward-word # ⌥→ +bindkey "^[[1;9D" beginning-of-line # cmd+← +bindkey "^[[1;9C" end-of-line # cmd+→ From 3d1288454c3c8efcdbb3036b55abc34b9aac8979 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:49:20 -0500 Subject: [PATCH 05/10] update --- custom/zshrc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index 339446180..1e900141f 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -11,7 +11,7 @@ export NVM_DIR="$HOME/.nvm" # Sync changes -THIS_CWD=`cwd` +THIS_CWD=${cwd} cd ~/.oh-my-zsh git pull git add . From 7d4953f56a456cb4a7ea146d0c31e8bf1c25bb71 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:49:40 -0500 Subject: [PATCH 06/10] update --- custom/zshrc.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index 1e900141f..9d18c7fcc 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -12,6 +12,7 @@ export NVM_DIR="$HOME/.nvm" # Sync changes THIS_CWD=${cwd} +echo $THIS_CWD cd ~/.oh-my-zsh git pull git add . From c0d6cd2f1eee2f901bf54e60ee20791839b48c7d Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:50:06 -0500 Subject: [PATCH 07/10] update --- custom/zshrc.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index 9d18c7fcc..6866b756c 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -11,14 +11,15 @@ export NVM_DIR="$HOME/.nvm" # Sync changes -THIS_CWD=${cwd} +cwd=$(pwd) + echo $THIS_CWD cd ~/.oh-my-zsh git pull git add . git commit -m "update" git push mine master -cd $THIS_CWD +cd $cwd bindkey "\e[1;3D" backward-word # ⌥← bindkey "\e[1;3C" forward-word # ⌥→ From bba9dd4d449d52d7b4607ed0c94f8dc79fac3ef5 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:50:37 -0500 Subject: [PATCH 08/10] update --- custom/zshrc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index 6866b756c..991a1e99b 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -18,7 +18,7 @@ cd ~/.oh-my-zsh git pull git add . git commit -m "update" -git push mine master +git push mine cd $cwd bindkey "\e[1;3D" backward-word # ⌥← From e34a4ab84bdb94465cd7340333c20ad6c1719db4 Mon Sep 17 00:00:00 2001 From: Michael W Clark Date: Fri, 14 Oct 2022 00:52:34 -0500 Subject: [PATCH 09/10] update --- custom/zshrc.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom/zshrc.zsh b/custom/zshrc.zsh index 991a1e99b..05198065d 100755 --- a/custom/zshrc.zsh +++ b/custom/zshrc.zsh @@ -15,10 +15,10 @@ cwd=$(pwd) echo $THIS_CWD cd ~/.oh-my-zsh -git pull -git add . -git commit -m "update" -git push mine +git pull >> /dev/null +git add . >> /dev/null +git commit -m "update" >> /dev/null +git push mine >> /dev/null cd $cwd bindkey "\e[1;3D" backward-word # ⌥← From cb7c55c4347327b5085c312cde003a5375679555 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 14 Oct 2022 06:09:23 +0000 Subject: [PATCH 10/10] update --- custom/plugins/zsh-autosuggestions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/plugins/zsh-autosuggestions b/custom/plugins/zsh-autosuggestions index ae315ded4..a411ef3e0 160000 --- a/custom/plugins/zsh-autosuggestions +++ b/custom/plugins/zsh-autosuggestions @@ -1 +1 @@ -Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d +Subproject commit a411ef3e0992d4839f0732ebeb9823024afaaaa8