Skip to content

Instantly share code, notes, and snippets.

@pvguerra
Last active July 17, 2021 13:43
Show Gist options
  • Save pvguerra/11bde64dd259549a4544a591d8e44d88 to your computer and use it in GitHub Desktop.
Save pvguerra/11bde64dd259549a4544a591d8e44d88 to your computer and use it in GitHub Desktop.
A readme with some steps needed to configure a clean macOS Big Sur 11.2 for development

macOS-dev

A readme with some steps needed to configure a clean macOS Big Sur 11.2 for development:

iTerm πŸ’»

Download iTerm is highly recommended.

Oh My ZSH! πŸ’»

Oh-My-ZSH is an open source, community-driven framework for managing your ZSH configuration.

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

Powerlevel10k (optional)

Powerlevel10k is a theme for Zsh.

$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k

$ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

Homebrew 🍺

Homebrew will install almost everything we'll need.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Here you will know more about brew formulaes.

PostgreSQL 13 🐘

πŸ““ Documentation

$ brew install postgresql

After installation don't forget to execute:

$ brew services start postgresql

Click here to search for other versions.

PHP 🐘

$ brew install php@7.4

Add the following to _~/.zshrc:

echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"' >> ~/.zshrc

echo 'export PATH="/usr/local/opt/php@7.4/sbin:$PATH"' >> ~/.zshrc

After installation don't forget to execute:

$ brew services start php

Click here to search for other versions.

Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker.

brew install redis and pecl install redis

Imagick

Some PHP apps could require imagick:

brew install imagemagick and pecl install imagick

Composer 🎢

πŸ““ Documentation

$ brew install composer

Laravel 8

πŸ““ Documentation

$ composer global require laravel/installer

$ laravel new example-app

NVM

  • Node 14 e NPM

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

  • Yarn

$ npm install --global yarn

Python 3

To install python with brew run:

brew install python3

pip3 install virtualenv virtualenvwrapper

# Setting PATH for Python 3 installed by brew
export PATH=/usr/local/share/python:$PATH

# Configuration for virtualenv
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh

Aliases ZSH

# Bash
alias zsho="nano ~/.zshrc"
alias zshr="source ~/.zshrc"
alias dev="cd /home/pauloguerra/Development"

# Git
alias gb="git branch"
alias gs="git status"
alias go="git checkout"
alias ga="git add -A"
alias gc="git commit"
alias gp="git push origin"
alias gu="git pull origin"
alias gm="git merge"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

# Git Flow
alias gffs="git flow feature start"
alias gfff="git flow feature finish"
alias gfrs="git flow release start"
alias gfrf="git flow release finish"

# PHP
brewphp () {
  brew unlink "$1" && brew link --force --overwrite "$2"
}

# Laravel
alias pa="php artisan"
alias pas="php artisan serve"
alias tinker="php artisan tinker"
alias pam="php artisan migrate"
alias pamfs="php artisan migrate:fresh --seed"
alias pamm="php artisan make:model"

# Composer
alias cda="composer dump-autoload"
alias cu="composer update"

# Django
alias pm="python manage.py"
alias pmr="python manage.py runserver"

# Services
alias pgsql-start="sudo service postgresql start"
alias redis-start="sudo service redis-server start"
alias mysql-start="sudo service mysql start"
@natanaelfneto
Copy link

sudo chown -R $(whoami) /usr/local/homebrew

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