Skip to content

Instantly share code, notes, and snippets.

@CavalcanteLeo
Last active Apr 5, 2018
Embed
What would you like to do?
style and aliases for .zshrc
export ZSH=/Users/Leo-KiddoLabs/.oh-my-zsh
export TERM="xterm-256color"
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
plugins=(git git-extras github atom)
ZSH_THEME="LeoTerminal"
# Set iTerm title to show current directory
if [ $ITERM_SESSION_ID ]; then
DISABLE_AUTO_TITLE="true"
echo -ne "\033];${PWD##*/}\007"
fi
precmd() {
echo -ne "\033];${PWD##*/}\007"
}
pr() {
git push -u origin "$1"
hub pull-request -h "$1" -F -
}
workdir(){
cd $1
chmod +x dev.sh
./dev.sh
}
#projects
polenghi(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];Polenghi\007"
workdir '/Users/Leo-KiddoLabs/Development/Clientes/Polenghi/site_oficial'
}
#projects
hero(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];Hero\007"
workdir '/Users/Leo-KiddoLabs/Development/Clientes/FS/hero_site'
}
allianz(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];Allianz\007"
workdir '/Users/Leo-KiddoLabs/Development/Clientes/allianz/allianz-maquina-capacitacao'
}
wecare(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];We Care\007"
cd '/Users/Leo-KiddoLabs/Development/Clientes/gps/we-care-wealth-management'
xc
}
popcorn(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];Popcorn Time\007"
cd '/Users/Leo-KiddoLabs/Development/PopcornTimeTV'
git pull
}
supercomics(){
DISABLE_AUTO_TITLE="true"
echo -ne "\033];Super Comics\007"
cd '/Users/Leo-KiddoLabs/Development/Clientes/Zed/Zed-Comics-iOS'
xc
}
alias dev="cd ~/Development"
alias kiddo="cd ~/Development/Kiddo"
alias clientes="cd ~/Development/Clientes"
# pastas e atalhos
alias terminal="atom ~/.zshrc"
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
alias DS_Store="find . -name '*.DS_Store' -type f -delete"
alias ghelp="less -R ~/.oh-my-zsh/plugins/git/git.plugin.zsh"
alias iphone="OPEN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
alias ssh_clientes="ssh root@138.197.92.216"
setTerminalText () {
# echo works in bash & zsh
local mode=$1 ; shift
echo -ne "\033]$mode;$@\007"
}
stt_both () { setTerminalText 0 $@; }
stt_tab () { setTerminalText 1 $@; }
stt_title () { setTerminalText 2 $@; }
function xc {
bold=$(tput bold)
normal=$(tput sgr0)
xcode_proj=`find . -name "*.xc*" -d 1 | sort -r | head -1`
if [[ `echo -n $xcode_proj | wc -m` == 0 ]]
then
echo "No xcworkspace/xcodeproj file found in the current directory."
else
echo "Opening ${bold}\033[1;32m$xcode_proj ${normal}"
open "$xcode_proj"
fi
}
timehidoc(){
appledoc '/Users/Leo-KiddoLabs/Development/Clientes/Time Hi/TimeHi-iOS' \
--project-name 'TimeHi' \
--project-company 'TimeHi' \
--company-id 'com.TimeHi' \
--templates '/Users/Leo-KiddoLabs/.appledoc/appledoc/Templates/' \
-o '/Users/Leo-KiddoLabs/Development/Clientes/Time Hi/TimeHi-iOS' \
--ignore ".m" \
--ignore "Pods" \
--ignore "*Controller.h" \
--ignore "*Cell.h" \
--explicit-crossref \
--keep-undocumented-objects \
--keep-undocumented-members \
--no-repeat-first-par \
--no-warn-missing-arg \
--no-warn-undocumented-object \
--no-warn-undocumented-member \
--no-warn-empty-description \
--docset-bundle-id "TimeHi" \
--docset-bundle-name "TimeHi" \
}
function gi() {
curl -L -s https://www.gitignore.io/api/$@;
}
new-proj () {
if [ -z "$1" ]; then
echo "Set function name:"
read NAME
else
NAME=$1
fi
if [ -z "$2" ]; then
echo "Set path to the project:"
read DEFINTION
else
if [ "$2" = "-cd" ]; then
DEFINTION='cd '
else
DEFINTION=$2
fi
fi
echo " " >> ~/.zshrc
echo " $NAME(){" >> ~/.zshrc
echo " cd '$DEFINTION' " >> ~/.zshrc
echo " chmod +x dev.sh " >> ~/.zshrc
echo " ./dev.sh " >> ~/.zshrc
echo " } " >> ~/.zshrc
. ~/.zshrc
}
bolsas(){
cd '/Users/Leo-KiddoLabs/Development/Clientes/affero/Bolsas de patrocinios'
chmod +x dev.sh
./dev.sh
}
HIST_STAMPS="dd/mm/yyyy"
source $ZSH/oh-my-zsh.sh
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source /Users/Leo-KiddoLabs/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
DEFAULT_USER="Leo"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment