Guest User

Untitled

a guest
Feb 2nd, 2019
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. variables=(
  2. "HTTP_PROXY"
  3. "HTTPS_PROXY"
  4. "ALL_PROXY"
  5. "all_proxy"
  6. "https_proxy"
  7. )
  8.  
  9. function reload () {
  10. source ~/.profile
  11. }
  12.  
  13. function set_registry_npm {
  14. npm config set registry="https://registry.npmjs.org/"
  15. }
  16.  
  17. function set_registry_alt {
  18.   npm config set registry="link_that_works_but_removed_for_StackOverflow"
  19. }
  20.  
  21. function load_proxy_full {
  22. echo -n "Enter Username: "
  23. read username
  24. echo -n "Enter your Password: "
  25. read -s password
  26. url=http://${username}:${password}@proxy-change.xxxx.com:8080
  27.  
  28. npm config set https-proxy ${url}
  29. npm config set proxy ${url}
  30.  
  31. export HTTP_PROXY=${url}
  32. export HTTPS_PROXY=${url}
  33. export ALL_PROXY=${url}
  34. export all_proxy=${url}
  35. export https_proxy=${url}
  36.  
  37. npm config delete registry
  38. }
  39.  
  40. function unload_proxy {
  41. unset ${variables[@]}
  42. npm config delete https-proxy
  43. npm config delete proxy
  44. }
  45.  
  46. export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
  47. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  48.  
  49. function parse_git_branch {
  50. git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
  51. }
  52.  
  53. # This allows git autocomplete
  54. if [ -f ~/.git-completion.bash ]; then
  55. . ~/.git-completion.bash
  56. fi
  57.  
  58. # Node Path from Homebrew I believe
  59. export NODE_PATH="/usr/local/lib/node_modules:$NODE_PATH"
  60.  
  61. export VISUAL="subl -w"
  62. export SVN_EDITOR="subl -w"
  63. export GIT_EDITOR="subl -w"
  64. export EDITOR="subl -w"
  65.  
  66. function desktop {
  67. cd /Users/$USER/Desktop/$@
  68. }
  69.  
  70. # Aliases
  71. alias l='ls -lah'
  72.  
  73. # Git
  74. alias gcl="git clone"
  75. alias gst="git status"
  76. alias gpl="git pull"
  77. alias gp="git push"
  78. alias gd="git diff | mate"
  79. alias ga="git add"
  80. alias gcm="git commit -m"
  81. alias gb="git branch"
  82. alias gba="git branch -a"
  83. alias gcam="git commit -am"
  84. alias gbb="git branch -b"
  85. alias glol="git log --oneline --decorate --all --graph"
  86.  
  87.  
  88. # Case-Insensitive Auto Completion
  89. bind "set completion-ignore-case on"
  90.  
  91.  
  92. # via homebrew
  93. if [ -f `brew --prefix`/etc/bash_completion ]; then
  94. . `brew --prefix`/etc/bash_completion
  95. fi
  96.  
  97. export ANDROID_HOME=~/Library/Android/sdk
  98. export PATH=${PATH}:${ANDROID_HOME}/tools
  99. export PATH=${PATH}:${ANDROID_HOME}/platform-tools
  100.  
  101. export PATH="$PATH:`yarn global bin`"
  102.  
  103. [[ -s "/Users/$USER/.rvm/scripts/rvm" ]] && source "/Users/$USER/.rvm/scripts/rvm" # This loads RVM into a shell session.
  104.  
  105. Load RVM into a shell session *as a function*
Add Comment
Please, Sign In to add comment