Skip to content

Instantly share code, notes, and snippets.

@swards
Created December 19, 2011 23:20
Show Gist options
  • Save swards/1499379 to your computer and use it in GitHub Desktop.
Save swards/1499379 to your computer and use it in GitHub Desktop.
Bookmarklet for switching between localhost and production
javascript:domain=%22www.mydomain.com%22;a=document.location.href.match(/http:\/\/([^\/]+)\/(.+)/);if(a[1].match(domain)){document.location=%22http://localhost:3000/%22+a[2]}else{document.location=%22http://%22+domain+%22/%22+a[2]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment