utilities.sh 589 B

123456789101112131415161718192021222324252627282930313233
  1. tinker() {
  2. if [ -z "$1" ]; then
  3. php artisan tinker
  4. else
  5. php artisan tinker --execute="\"dd($1);\""
  6. fi
  7. }
  8. initialStuff() {
  9. php artisan optimize:clear; \
  10. php artisan event:cache; \
  11. php artisan config:cache; \
  12. php artisan route:cache;
  13. }
  14. # Determine size of a file or total size of a directory
  15. fs() {
  16. if du -b /dev/null >/dev/null 2>&1; then
  17. local arg=-sbh
  18. else
  19. local arg=-sh
  20. fi
  21. if [[ -n "$@" ]]; then
  22. du $arg -- "$@"
  23. else
  24. du $arg .[^.]* ./*
  25. fi
  26. }
  27. # Commonly used aliases
  28. alias ..="cd .."
  29. alias ...="cd ../.."
  30. alias art="php artisan"