Guest User

Untitled

a guest
Feb 18th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #PROMPT STUFF
  2. GREEN=$(tput setaf 2);
  3. YELLOW=$(tput setaf 3);
  4. WHITE=$(tput setaf 7)
  5.  
  6. function git_branch {
  7. # Shows the current branch if in a git repository
  8. git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/';
  9. }
  10.  
  11. rand() {
  12. printf $(( $1 * RANDOM / 32767 ))
  13. }
  14. rand_element () {
  15. local -a th=("$@")
  16. unset th[0]
  17. printf $'%s\n' "${th[$(($(rand "${#th[*]}")+1))]}"
  18. }
  19. #Default Prompt
  20. PS1="${YELLOW}\w${GREEN}\$(git_branch)${WHITE}\n$(rand_element 😅 👽 🔥 🚀 👻 ⛄ 👾 🍔 😄 🍰 🐑) $ ";
  21.  
  22. # git aliases
  23. alias gc="git commit -m $1";
  24. alias gs="git status";
  25. alias gpull="git pull";
  26. alias gf="git fetch";
  27. alias gpush="git push";
  28. alias gco="git checkout";
  29.  
  30. # npm aliases
  31. alias ni="npm install";
  32. alias nrs="npm run start";
  33. alias nrb="npm run build";
  34. alias nrt="npm run test";
  35. alias rmn="rm -rf node_modules;"
  36. alias flush-nom="rm -rf node_modules && npm cache clean && npm install";
  37.  
  38. # Hardware aliases
  39. alias renew1="sudo ipconfig set en1 BOOTP && sudo ipconfig set en1 DHCP";
  40. alias renew0="sudo ipconfig set en1 BOOTP && sudo ipconfig set en1 DHCP";
  41.  
  42. #Funness
  43. alias weather="curl -4 wttr.in/slc";
Add Comment
Please, Sign In to add comment