I'm in a constant battle to make my development environment as simple and fast as possible. To that end I've got a few recommendations and tools that I use to make life easy.
homebrew + casks
Homebrew has to be one of the greatest things about being on a mac. You can use it to install a variety of useful tools. For example, I use it to install mongoldb, redis, nginx, and imagemagick. It manages all the dependancies. It installs the latests version of that software that is appropriate for your system. It even connects some of the executables to the your PATH. It does all that for you.
With the edition of casks it can also install Mac applications. I use it to install chrome, atom, and many other common development applications.
The real magic begins when you pair it with homebrew bundle. This allows you to export your homebrew setup to a brewfile that you can later use to restore everything. In essence you can go to another computer and restore a good chunk of your development setup in a few lines.
$> brew tap Homebrew/bundle #install bundle $> brew bundle dump #create a brewfile of your current environment $> brew bundle #reload from an existing brewfile.
I keep a copy of my brewfile in the cloud and I can get up and running on a new box rather quickly.
I learned this trick rather recently. Say you are the developer at
toronto.mycode.com and you need to maintain that subdomain in your local development. There are many ways to accomplish this. You can add a hosts file entry.
This can be cumbersome because you would have to disable it often to use your live site.
You can optionally use
*.dev or some other schema like this but as more gTLD's become available stuff like
*.dev is no longer safe to use. Solutions that use DNSmasq are also a bit inconvenient and potentially suffer from the same problem.
I've started to use
*.localhost to solve this. To direct traffic to my local server I use
toronto.mycode.localhost. This doesn't require dnsmasq or an entry in my hosts file. Currently, only chrome supports this but firefox will adopt it soon.
When it comes to getting feedback nothing is better than people using your site. But that can often require you to deploy that code so that people can access it. Not everyone can simply look over your shoulder to see your latest code. In past that meant deploying your current code to a staging environment to get some feedback. But with ngrok you can simply share a url that is a private tunnel to your localhost. This means you can just keep developing and the user can see your latest code with just a quick refresh. I've used this many times in the past to share my current work with non-developers. It saves a ton of time and when you are done you can simply turn off the tunnel. The basic tool is free. You can pay a monthly rate for some advanced features but I have been quite satisfied with the free version.