RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' function dockerize() { CURRENT_DIR="$(pwd)/" TEMPLATE_DIR="${HOME}/Code/template-boilerplate/" cp -r "${TEMPLATE_DIR}docker" $CURRENT_DIR cp -r "${TEMPLATE_DIR}deployments" $CURRENT_DIR cp "${TEMPLATE_DIR}.dockerignore" $CURRENT_DIR cp "${TEMPLATE_DIR}.gitlab-ci.template.yml" $CURRENT_DIR cp "${TEMPLATE_DIR}Dockerfile" $CURRENT_DIR cp "${TEMPLATE_DIR}docker-compose.yml" $CURRENT_DIR cp "${TEMPLATE_DIR}docker-setup" $CURRENT_DIR echo "${GREEN}SUCCESS: Folder '${CURRENT_DIR}' successfully dockerized${NC}" php docker-setup $1 $2 $3 rm docker-setup } function artisan() { php artisan "$@" } function vartisan() { valet php artisan "$@" } function commit() { commitMessage="$*" git add . if [ "$commitMessage" = "" ]; then aicommits return fi eval "git commit -a -m '${commitMessage}'" } function composer() { /opt/homebrew/bin/php -d memory_limit=-1 /opt/homebrew/bin/composer "$@" } function vcomposer() { valet composer "$@" } function cat() { bat --theme ansi "$@" } function ghr() { gh repo clone roundly-consulting/$1 cd $1 } function ghl() { gh repo create roundly-consulting/$1 --private --template spatie/package-skeleton-laravel ghr $1 pstorm . } man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ LESS_TERMCAP_se=$(printf "\e[0m") \ LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ LESS_TERMCAP_ue=$(printf "\e[0m") \ LESS_TERMCAP_us=$(printf "\e[1;32m") \ man "$@" } function mk() { mkdir -p "$@" && cd "$@" } function e() { if [[ ! -f .env ]]; then echo -e "${RED}Error: .env file does not exists${NC}" && return fi cat .env @ $1 } extract () { if [ -f $1 ]; then case $1 in *.tar.bz2) tar -jxvf $1 ;; *.tar.gz) tar -zxvf $1 ;; *.bz2) bunzip2 $1 ;; *.dmg) hdiutil mount $1 ;; *.gz) gunzip $1 ;; *.tar) tar -xvf $1 ;; *.tbz2) tar -jxvf $1 ;; *.tgz) tar -zxvf $1 ;; *.zip) unzip $1 ;; *.ZIP) unzip $1 ;; *.pax) cat $1 | pax -r ;; *.pax.Z) uncompress $1 --stdout | pax -r ;; *.rar) unrar x $1 ;; *.Z) uncompress $1 ;; *) echo -e "${RED}Error: '$1' cannot be extracted/mounted via extract()${NC}" ;; esac else echo "${RED}Error: '$1' is not a valid file${NC}" fi } function xterm_title_precmd () { print -Pn '\e]2;%~\a' } function xterm_title_preexec () { print -Pn '\e]2;' print -n "${(q)1}\a" } function youtube_song () { youtube-dl --audio-format m4a -x "$@" } function joke() { echo $(curl -s https://icanhazdadjoke.com) }