Skip to content

Instantly share code, notes, and snippets.

@RatulHasan
Last active July 16, 2023 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RatulHasan/3fabbb1140ae32a4c1eee78096587f38 to your computer and use it in GitHub Desktop.
Save RatulHasan/3fabbb1140ae32a4c1eee78096587f38 to your computer and use it in GitHub Desktop.
Setup Dev environment on new Mac

Setup Dev environment on new Mac

Install Stats

  • https://github.com/exelban/stats

Install brew.

  • /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • export PATH=/opt/homebrew/bin:$PATH
  • Warning: Homebrew's "sbin" was not found in your PATH but you have installed formulae that put executables in /opt/homebrew/sbin. Consider setting your PATH for example like so: echo 'export PATH="/opt/homebrew/sbin:$PATH"' >> ~/.zshrc

Install git

  • brew install git

Install ohmyzsh on iTerm2,

  • First download iTerm2

  • sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

  • git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

  • open ~/.zshrc then, put this line in plugins=(git zsh-autosuggestions)

  • git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

  • ZSH_THEME="powerlevel10k/powerlevel10k"

  • git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

  • echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

  • source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Install composer

  • brew install composer

Install node

  • brew install node

Install nvm

  • curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

  • You should create NVM's working directory if it doesn't exist: mkdir ~/.nvm

  • Add the following to your shell profile e.g. ~/.profile or ~/.zshrc:

    export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion

  • nvm install 18.15.0

Install PHP

  • brew install php
If you want to install a specific version-
  • brew tap shivammathur/php
  • brew install shivammathur/php/php@7.4
If you need to have php@7.4 first in your PATH, run:
  • echo 'export PATH="/opt/homebrew/opt/php@7.4/bin:$PATH"' >> ~/.zshrc
  • `echo 'export PATH="/opt/homebrew/opt/php@7.4/sbin:$PATH"' >> ~/.zshrc'
For compilers to find php@7.4 you may need to set:
  • export LDFLAGS="-L/opt/homebrew/opt/php@7.4/lib"
  • export CPPFLAGS="-I/opt/homebrew/opt/php@7.4/include"
To restart shivammathur/php/php@7.4 after an upgrade:
  • brew services restart shivammathur/php/php@7.4

Install Valet

  • composer global require laravel/valet
  • valet install If zsh: command not found: valet, then export PATH=$PATH:~/.composer/vendor/bin
  • valet trust
  • cd Sites
  • valet park

Install phpmon

  • brew tap nicoverbruggen/homebrew-cask
  • brew install --cask phpmon

Install Mysql

  • brew install mysql, then follow the instruction.

Install phpmyadmin

  • brew install phpmyadmin
  • cd /opt/homebrew/share/phpmyadmin
  • valet link
  • valet restart

Install pnpm

  • npm install -g pnpm
  • If you installed Node.js using Homebrew, you'll need to install corepack separately: brew install corepack

For productivity I use-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment