Based on this gist
-
Install Sublime Text or Visual Studio Code
-
Configure text editor
2.1. Sublime Text
Create
subl
commandsudo mkdir -p /usr/local/bin/ && sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Install package manager as shown here
Configure user settings (Sublime Text -> Preferences -> Settings)
{ "ensure_newline_at_eof_on_save": true, "font_size": 12, "show_encoding": true, "tab_size": 2, "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true }
2.2. Visual Studio Code
Create
code
command Open the Command Palette(⇧⌘P)
and type shell command to find the Shell Command: Install 'code' command in PATH command. Restart the terminal for the new$PATH
value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.Configure user settings
(⇧⌘P)
and type user settings and select Preferences: Open User Settings Depending on your VSCode version you will see a JSON view of the settings by default or not. If it doesn't show at first you can click a{}
button on the top right that will show you the settings JSON view.{ "explorer.confirmDelete": false, "editor.scrollBeyondLastLine": false, "editor.wordWrap": "on", "files.trimTrailingWhitespace": true, "editor.tabSize": 2, "markdown.preview.scrollPreviewWithEditor": false, "[python]": { "editor.tabSize": 4, }, "files.insertFinalNewline": true, "markdown.preview.scrollEditorWithPreview": false, "html.suggest.html5": false, "editor.quickSuggestions": { "other": true, "comments": false, "strings": true }, "window.zoomLevel": 0, "python.venvPath": "~/.virtualenvs", }
-
Install Xcode from the AppStore
-
Open Xcode and accept the licence
-
Install command line tools. From the terminal run:
xcode-select --install
-
Install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Run brew doctor
brew doctor
-
Update homebrew
brew update
-
Install git
brew install git
-
Install RVM
curl -L https://get.rvm.io | bash -s stable --autolibs=enabled source ~/.rvm/scripts/rvm
-
Install Ruby and default Ruby version
rvm use ruby --install --default
-
Configure no doc
vim ~/.gemrc
Paste this:
gem: --no-rdoc --no-ri
-
Install rails and bundler
gem install rails bundler
-
Install wget
brew install wget
-
Install node and npm
brew install node
-
Configure git (import config if migrating from another computer)
ssh-keygen -t rsa -C "YOUR GENERATED EMAIL" git config --global user.email "YOUR EMAIL" git config --global user.name "YOUR NAME" git config --global color.ui true
-
Install mysql
brew install mysql brew services start mysql
-
Install Postgres app from here
-
Install Docker Desktop app from here
-
Configure PATHs:
Openbash_profile
:vim ~/.bash_profile
Paste the following:
export PATH=$PATH:/usr/local/bin export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
Save those changes and exit.
Finally, apply those changes:
source ~/.bash_profile
-
Open
psql
(typepsql
in your terminal) and run:CREATE USER postgres SUPERUSER;
-
Install python3
brew install python3
-
Setup python's env management Install virtualenv
pip3 install virtualenv
Install virtualenvwrapper
pip3 install virtualenvwrapper
Use the following command to find the location of Python3 on your system
which python3
Add the following lines to
~/.bash_profile
(or your own shell's initialisation file)VIRTUALENVWRAPPER_PYTHON='<Python3 location>' source /usr/local/bin/virtualenvwrapper.sh export WORKON_HOME=$HOME/.virtualenvs
Run the following commands
mkdir ~/.virtualenvs source ~/.bash_profile
All the virtual environments created using virtualenvwrapper will now be stored in
~/.virtualenvs
To create new Python3 virtual environment
mkvirtualenv <project name>
The virtualenv will automatically activate after creation
To exit the virtualenv
deactivate
To access the virtualenv
workon <project name>
-
General MAC OS config
Show Path bar in Finderdefaults write com.apple.finder ShowPathbar -bool true
Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
-
Other
Install libxsltbrew install libxslt
Add aliases:
vim ~/.gitconfig
Add the following
[alias] tree = log --oneline --decorate --all --graph s = status backup = "!f() { \ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD); \ NEW_BRANCH_NAME=\"${BRANCH_NAME}_backup\"; \ git checkout -b $NEW_BRANCH_NAME; \ git checkout $BRANCH_NAME; \ }; f" squash = "!f(){ git backup && git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
Configure git for bash:
-
JUST IF ERRORS APPEAR WHILE BUNDLING:
gem uninstall libv8 brew install v8 gem install therubyracer gem install libv8 -v '3.16.14.3' -- --with-system-v8