Skip to content

Instantly share code, notes, and snippets.

@thacherhussain
Last active November 24, 2016 05:54
Show Gist options
  • Save thacherhussain/a48c08efecca86aa6f121889c60cce78 to your computer and use it in GitHub Desktop.
Save thacherhussain/a48c08efecca86aa6f121889c60cce78 to your computer and use it in GitHub Desktop.
Setting up your Mac OS X Development Environment

Mac OS X for Web Development

Setting up my machine to learn to web development was something I really struggled with before having access to the professional developers that taught my bootcamp program. This guide is based on what they walked us through -- I wish I had had this when I was banging around trying to learn on my own!

This article assumes your computer:

  • Is running Mac OS X 10.12 El Capitan or above
  • Is virus and malware free
  • Uses the latest, stable version of its operating system
  • Has a functioning screen, keyboard, and trackpad
  • Has plenty of free hard drive space and memory
  • Can reliably connect to wireless networks

This laptop will not work:

busted laptop

First things first

Save all files you may have open and close all other applications. (If you are at home and want to make a backup of your computer just in case, now would be the time).

Make sure that you have your computer username and password memorized or handy and that you are the admin (or root) user for the computer (more help with user types here).

Mac OS X Updates

Before we dive in to modifications, open the AppStore application and check if you have any updates -- unless you are sure you don't need them, just accept all updates. This may take some time to download and install, but it is important to be starting with the most up to date operating system and tools.

If you don't have it installed already, search for and install Xcode.

When you're done, if it's not already required, reboot your computer.

Checklist:

  • Updated to the latest version of Mac OS X
  • Installed/Updated Xcode from the AppStore
  • Run all updates from the AppStore
  • Closed all applications
  • Restarted your computer

The Terminal

Included in Mac OS X is the Terminal—an app that runs a Unix shell. A Unix shell is a command line user interface between you and your computer's operating system.

Terminal Options

There are many different options to customize your terminal app, however, rather than messing with the Mac OS X app, I recommend using iTerm with zsh.

First, download and install iTerm2

You can customize the look of iTerm from the preferences menu OR follow this guide to install z shell and oh-my-zsh for even more functionality.

Install Homebrew

Now that your Terminal is setup, it's time to install Homebrew, the de facto package manager for OS X. If you've never heard of a package manager, think of it as an app store for free command line programs.

To get started, run the following command in your shell. It'll download and run a script file that downloads and installs Homebrew onto your development environment.

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

If asked, be sure to agree when asked to install the Xcode CommandLine Tools. It may take about 10 minutes to download and install.

Update Homebrew

If you've previously installed Homebrew, now's a good time to update it by running the following command.

brew update

If it's been a while since the last update, you'll see something like this.

PROTIP: Run this command periodically as Homebrew doesn't automatically update itself.

Verify Homebrew

To verify Homebrew is installed correctly, run the following command.

brew doctor

Install and Configure Chrome

Now it's time to install Google Chrome, a fast and free web browser that automatically updates itself with the latest web technologies.

Download Chrome, open the disk image file, and drag the app icon into your /Applications folder.

PROPROTIP: Allow Chrome to become your default browser.

Firefox Developer Edition is also a solid choice for developers, but I prefer Chrome.

Navigate to the Chrome > Preferences -- scroll to the bottom of the page and click the Show advanced settings... link. Scroll down a bit more until you find the Send a "Do Not Track" request with your browser traffic and check the box.

PROTIP: You may want to consider installing an ad blocking extension to Chrome.

Other Helpful Chrome Extensions

Dev Related:

  • AdBlock
  • Block Site
  • Personal Blocklist
  • Pesticide for Chrome
  • JSONView

Other:

  • Kill News Feed
  • Momentum

Install and Configure Atom

Now it's time to install Atom, a hackable text editor for the 21st century.

To get started, download Atom, unzip the archive file, and drag the app icon into your /Applications folder. Double click to open atom.

Close any tabs by pressing Command + W. Then, navigate to the Atom > Preferences menu item by pressing the Command + , .

Under the Settings tab, in the Editor Settings section, change the following:

Name Value
Font Family Menlo
Font Size 18
Show Indent Guide Checked

Under the Install tab, with the Package button highlighted, install the following:

Name Type
file-icons Package
language-fish-shell Package

Under the Install tab, with the Themes button highlighted, install the following:

Name Type
tomorrow-night-eighties-syntax Syntax Theme

Under the Packages tab search for autosave -- under Core Packages click the Settings button, in the Settings section check Enabled.

When you're done, close the preferences tab by pressing Command + W.

Install the Shell Commands

You'll find it insanely useful to open files and directories into Atom from the Terminal.

To get started, select the Atom > Install Shell Commands menu item.

Discover the EDITOR environment variable

Environment variables like EDITOR can be set in a shell's startup file. While Fish's startup file is handy, add the following settings.

# Atom
set -x EDITOR 'atom -w'

Now, relaunch the Terminal and verify these settings with the following command.

echo $EDITOR

Install and Configure Git

Using Homebrew, you can also install Git, the version control system of choice among choosy developers.

To get started, run the following command.

brew install git

Once it finishes, run the following command.

git --version

Let's configure Git to sign your commits with your name and email address.

WARNING: Before running the following commands, replace YOUR FULL NAME and YOUR EMAIL ADDRESS with the name and email from your GitHub account.

git config --global user.name 'YOUR FULL NAME'
git config --global user.email 'YOUR EMAIL ADDRESS'

Install Node

Using Homebrew, you can also install Node, an open-source, cross-platform runtime system for developing applications in JavaScript. In other words, it runs JavaScript outside the browser.

To get started, run the following command.

brew install node

Once it finishes, run the following command.

node -v

Congratulations!

You've successfully setup a web development environment on Mac OS X!

###Other Useful Dev Tools These are a few other tools that can be helpful for different aspects of development:

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