Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
494
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. Load RVM into a shell session *as a function*
  49.  
  50. function parse_git_branch {
  51. git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
  52. }
  53.  
  54. # This allows git autocomplete
  55. if [ -f ~/.git-completion.bash ]; then
  56. . ~/.git-completion.bash
  57. fi
  58.  
  59. # Node Path from Homebrew I believe
  60. export NODE_PATH="/usr/local/lib/node_modules:$NODE_PATH"
  61.  
  62. export VISUAL="subl -w"
  63. export SVN_EDITOR="subl -w"
  64. export GIT_EDITOR="subl -w"
  65. export EDITOR="subl -w"
  66.  
  67. function desktop {
  68. cd /Users/$USER/Desktop/$@
  69. }
  70.  
  71. # Aliases
  72. alias l='ls -lah'
  73.  
  74. # Git
  75. alias gcl="git clone"
  76. alias gst="git status"
  77. alias gpl="git pull"
  78. alias gp="git push"
  79. alias gd="git diff | mate"
  80. alias ga="git add"
  81. alias gcm="git commit -m"
  82. alias gb="git branch"
  83. alias gba="git branch -a"
  84. alias gcam="git commit -am"
  85. alias gbb="git branch -b"
  86. alias glol="git log --oneline --decorate --all --graph"
  87.  
  88.  
  89. # Case-Insensitive Auto Completion
  90. bind "set completion-ignore-case on"
  91.  
  92.  
  93. # via homebrew
  94. if [ -f `brew --prefix`/etc/bash_completion ]; then
  95. . `brew --prefix`/etc/bash_completion
  96. fi
  97.  
  98. export ANDROID_HOME=~/Library/Android/sdk
  99. export PATH=${PATH}:${ANDROID_HOME}/tools
  100. export PATH=${PATH}:${ANDROID_HOME}/platform-tools
  101.  
  102. export PATH="$PATH:`yarn global bin`"
  103.  
  104. [[ -s "/Users/$USER/.rvm/scripts/rvm" ]] && source "/Users/$USER/.rvm/scripts/rvm" # This loads RVM into a shell session.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement