When using a framework, any framework:

source code > documentation.

Always read/reference the source.

Local *.dev and *.app via Dnsmasq on Mac OS X

I am in the process of setting up a development environment on a new machine and one of the things I decided to do is route all .dev domains to my local (built-in) Apache web server while I route all .app domains to my Laravel Homestead Vagrant environment.

To never have to monkey with your hosts file, Apache can be configured to serve any .dev domain that matches an existing folder name from a base directory. The Homestead.yaml file handles domain-to-directory mapping explicitly for the Laravel Vagrant environment.

This ended up being really easy – the things I needed to know were:

  1. what to put into the dnsmasq config
  2. how to stop and start dnsmasq

All of the “install Dnsmasq mac” tutorials out there seem to work fine. Assuming, you’ve already installed Homebrew, it’s as simple as:

brew install dnsmasq

From there, you’ll follow the recommended step from the installer output to create your config file:

cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf

Now open that file in your favorite editor and replace its contents with:

# General sites (Apache)

# Laravel Homestead (Vagrant)

Lastly, stop and start Dnsmasq to apply the changes in the config:

sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq

That’s it! Or at least that’s all it took for me. I hope your experience is as easy as mine was.

Now to set up Apache to handle anything with a .dev suffix from a matching directory from my Sites dir. Add this to your vhost configuration:

<Directory "/Users/example/Sites/">
  AllowOverride All
  Options Indexes MultiViews FollowSymLinks
  Require all granted

<VirtualHost *:80>
  ServerName local.dev
  ServerAlias *.dev
  UseCanonicalName off
  VirtualDocumentRoot /Users/example/Sites/%-2.0.dev/

Restart Apache with errors returned to find errors in your config:

sudo apachectl -e info -k restart

If you get a 403 error when loading your site in a browser, make sure that every dir in the chain to the web root has the “execute” permission. Add it via:

chmod +x dirname

That should do it.

Improvements/corrections to the above solution are welcome. Enjoy!

Star Wars VII, Trailer 2

The new Star Wars trailer is fantastic. Take a minute to look at the scene by scene breakdown at The Verge. And today the Battlefront game trailer was released. I’m not a gamer, but this looks pretty impressive.

OS X Reviewed →

Thanks to John for writing the canonical OS X reviews for so long. It sometimes took me weeks to finish them but I always learned things that helped me get more out of my tools. I look forward to hearing his thoughts on the next OS version on ATP.

An Interview with The Dan Plan →

An interesting Q&A session with the fellow who is testing the Malcolm Gladwell 10,000 hours posit by learning how to golf. I was interested to see he’s a 3 handicap now, about halfway through his journey.

Twitter and What Might Have Been →

Indeed, I would argue that what makes Twitter the company valuable is not Twitter the app or 140 characters or @names or anything else having to do with the product: rather, it’s the interest graph that is nearly priceless.

This is a really interesting way to look at Twitter as a business: based on who I follow, searches I do, etc., they know what topics I’m interested in and am willing to spend time on. I agree that this type of “interest” data should be incredibly valuable as it’s own product.

TIL: If you leave it to run overnight, Dropbox really will finish syncing 250k+ files to a new machine.

Designing for Humans — Accounting for Inclusivity and Accessibility

Dave does a really nice job calling out things with a nice mix between “gentle nagging” and “teaching”. If everyone who makes things spent 6 minutes watching this video and then let it seep into their consciousness, I believe they would inherently ask more questions and consider more conditions as they strive to create a…

Seven Plus or Minus Three →

I didn’t implement this at Crowd Favorite and, retrospectively, I wish I had. Not having to worry about this at all anymore is a definite plus to being back on my own.

The golf world finally getting what they want with Tiger Woods and Rory McIlroy playing together at The Masters on Sunday.

Sadly, chasing from 10 shots back.

I can’t convince my Apple TV to reliably AirPlay or play music from iCloud or rented movies from iTunes, but it handles MLB.tv like a champ.

Why I’m Buying a Macbook →

Steve and I have been drooling over this machine for a month now. Mine is also on order, and I am not feeling particularly patient about it. Hurry up and get here!

UPDATE: Steve calls out two features that other reviews haven’t spent much time on:

  1. The power brick is absurdly tiny and light compared to Apple’s other laptop chargers. This is a huge benefit for anyone who carries a charger with them, though the 9 hours of battery life means this probably only happens for me when I’m traveling.
  2. USB C is the new kid on the block now, but it looks to have the kind of early inertia that can propel it to becoming a new standard for both Apple and non-Apple laptops sooner rather than later.