Basic Dev Set Up for MAC OS X

CyberCode Twins 👾 👾
4 min readNov 9, 2018

--

Make sure to have this development environment setup on your Mac to follow along any upcoming live streams. If you prefer to see a video tutorial…skip all the way to the bottom.

HOMEBREW

The preferred package manager for macOS. homebrew installs the things Apple didn’t via the command line. It also makes it easy to update them and fix them if something is wrong. If the brew command is not found, you need to installhomebrew following the instructions below. Can take between 5–8 minutes to download.

Installation

Install homebrew and then press the return key.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To update homebrew, run:

brew update

To upgrade local packages, run:

brew upgrade

Yay! You should have homebrew now! Make sure to update your path to include the command below or otherwise the system-provided programs will be used instead of those provided by homebrew.

echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

Homebrew-Cask

Homebrew-Cask extends Homebrew and allows you to install large binary files via a command-line tool. No more downloading .dmg files and dragging them to your Applications folder!

Installation

You need Homebrew on your system to use Cask, and you make Cask available by adding it as a tap:

$ brew tap caskroom/cask

Git and GitHub

Git is a revision control system, a tool to manage your source code history. GitHub is a hosting service for Git repositories. Git is the tool and GitHub is the service for projects that use Git.

Installation

To download and install the latest git:

brew install git

To see if it installed correctly, run the following commands.

git --version
which git

The command above should output /usr/local/bin/git .

Next, define your git user with the same name and email you use for GitHub.

git config --global user.name "Github UserName"
git config --global user.email "Github Email"

Use the recommended HTTPS method (versus SSH), if you want to push code to your GitHub repositories. If you don’t want to type your username and password every time, let’s type the following command.

git config --global credential.helper osxkeychain

Important files to Ignore in Git

.gitignore is a special file that tells Git what files you want to automatically exclude from repositories. There are certain types of files that you don’t want to commit because they’re not actually part of your project, or because they are impractical to include in version control.

On a Mac, it is important to remember to add .DS_Store (a hidden OS X system file that’s put in folders) to your .gitignore files. You can configure your Git to globally exclude those more files:

# specify a global exclusion list
$ git config --global core.excludesfile ~/.gitignore

If you want to never include .DS_Store files in your Git repositories, type the following command below.

# adding .DS_Store to that list
$ echo .DS_Store >> ~/.gitignore

Authenticating SSH with GitHub

Generate a public/private RSA key pair using your GitHub email.

ssh-keygen -t rsa -b 4096 -C “Github Email”
#Enter file in which to save the key (/Users/you/.ssh/id_rsa):

Make sure to [Press enter] and use a strong passphrase for your keys.

To configure the ssh-agent program to use your SSH key, first ensure ssh-agent is enabled with the command below.

eval "$(ssh-agent -s)"

Then, add your SSH key to the ssh-agent.

ssh-add -K ~/.ssh/id_rsa

Then, copy your SSH keys with the command below. Then paste them to the SSH keys in the GitHub settings to let GitHub know about your SSH key. Run this command to copy your key to your clipboard:

pbcopy < ~/.ssh/id_rsa.pub

Authenticate them to GitHub with this command.

ssh -T git@github.com

You should be receiving the following message: Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.

Atom

Developers have their own preferences when it comes to text editors (the tool you use to write your code). You will hear about Vim, Emacs, TextMate, etc. I prefer to use Atom, although I have used Sublime in the past and it was pretty nice. Atom is completely free, customizable, and has thousands of packages. Can take between 5–8 minutes to download.

Installation

Go to your terminal and enter:

$ brew cask install atom

It may ask you for your computer password before it finishes installing. You can now find atom in your applications folder!

Node

Installing node will also install NPM (node package manager) which aids in package installation, versioning, and dependencies. In simpler terms, NPM is used to install frameworks and libraries, such as React.js, to your project on the command line. Can take between 5–8 minutes to download.

Installation

Open up your command line and enter:

$ brew install node

Check the version to confirm it installed:

$ node -v

You should get version numbers for both of those if installed successfully.

Docker

Installing Docker for Mac for easy installation.

Summary

We hope this helped you get your computer setup and ready for development on the day of the workshop or for any upcoming livestreams in the near future.

Video Tutorial

--

--

CyberCode Twins 👾 👾

#TEDx Speakers🎙️| M.I.T Media Lab BC Alumni ⛓️| Top 5 IBM #SmartCities Finals 🌇 | 🚀PR 🇵🇷 LA | #AI #Blockchain #SocialImpact| CyberCodeTwins.com |