Skip to content

Instantly share code, notes, and snippets.

@thomasjbradley
Last active December 11, 2015 09:49
Show Gist options
  • Save thomasjbradley/4582681 to your computer and use it in GitHub Desktop.
Save thomasjbradley/4582681 to your computer and use it in GitHub Desktop.
Launches my browser and goes to the correct vhost and folder from terminal
#!/usr/bin/env python
import os
cwd = os.getcwd().replace("/Users/thomasjbradley/Dropbox/www/", "")
domain = "http://"
dir_bits = cwd.split("/")
domain += dir_bits.pop(0)
domain += ".dev/"
path = "-".join(dir_bits)
domain += path
os.system("/usr/bin/open -a '/Applications/Google Chrome Canary.app' '" + domain + "'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment