How do I get the current Salesforce domain?

Here’s a quick Javascript hack:

window.location.host.split('.')[0]