Advertisement
Guest User

kevin's terminal stuff

a guest
Jan 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.44 KB | None | 0 0
  1. alias dev='cd /Users/kev/dev'
  2. alias fjall='cd /Users/kev/dev/oakwood/fjallraven/wp-content/themes/fjallraven/assets'
  3.  
  4. alias ga='git add'
  5. alias gco='git checkout'
  6. alias yolo='git reset --hard'
  7. alias gs='git status'
  8. alias gm='git commit -m'
  9. alias glo='git log --oneline --decorate'
  10. alias gcod='git checkout develop'
  11. alias gcom='git checkout master'
  12. alias stash='git stash'
  13. alias pop='git stash pop'
  14. alias gdr='git push origin --delete'
  15. alias gdl='git branch -d'
  16.  
  17. alias ls='ls -GAl'
  18. alias link='jspm install --link apsis:tenko@dev'
  19. alias gulpsi='gulp --skipinstall'
  20.  
  21. # Lock the screen (when going AFK)
  22. alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
  23.  
  24. # Reload the shell (i.e. invoke as a login shell)
  25. alias reload="exec $SHELL -l"
  26.  
  27. # the fuck?
  28. eval "$(thefuck --alias)"
  29.  
  30. # DEPLOY
  31. alias deploy='rocketeer deploy -S'
  32.  
  33. # git flow aliases
  34. alias gf='git flow'
  35. alias gff='git flow feature'
  36. alias gffs='git flow feature start'
  37. alias gfff='git flow feature finish'
  38. alias gfr='git flow release'
  39. alias gfrs='git flow release start'
  40. alias gfrf='git flow release finish'
  41.  
  42. alias md='mkdircd_func'
  43.  
  44. alias server='npm run kraftverk-server'
  45. alias build='npm run kraftverk-build'
  46. alias app='node index'
  47.  
  48. mkdircd_func () {
  49.   mkdir -p "$@" && cd "$@"
  50. }
  51.  
  52. # clones a repository & cds into it
  53. # - arg 1 - url|username|repo remote endpoint, username on github, or name of
  54. #           repository.
  55. # - arg 2 - (optional) name of repo
  56. #
  57. # usage:
  58. #   $ clone things
  59. #     .. git clone git@github.com:stephenplusplus/things.git things
  60. #     .. cd things
  61. #     .. subl .
  62. #
  63. #   $ clone git@github.com:stephenplusplus/dots.git
  64. #     .. git clone git@github.com:stephenplusplus/dots.git dots
  65. #     .. cd dots
  66. #     .. subl .
  67. #
  68. #   $ clone yeoman generator
  69. #     .. git clone git@github.com:yeoman/generator.git generator
  70. #     .. cd generator
  71. #     .. subl .
  72.  
  73.  
  74. function clone {
  75.   # customize username to your own
  76.   local username="kvzivn"
  77.  
  78.   local url=$1;
  79.   local repo=$2;
  80.  
  81.   if [[ ${url:0:4} == 'http' || ${url:0:3} == 'git' ]]
  82.   then
  83.     # just clone this thing.
  84.     repo=$(echo $url | awk -F/ '{print $NF}' | sed -e 's/.git$//');
  85.   elif [[ -z $repo ]]
  86.   then
  87.     # my own stuff.
  88.     repo=$url;
  89.     url="git@github.com:$username/$repo";
  90.   # else
  91.   #   # not my own, but I know whose it is.
  92.   #   url="git@github.com:$url/$repo.git";
  93.   fi
  94.  
  95.   git clone $url $repo && cd $repo;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement