Tag Archive for 'Mac'

Safari 4

So, first impressions: feels pretty snappy; tab placement was confusing for 2 minutes but now I really like it, though I agree it doesn’t make sense for the bookmarks bar to be within a tab; Top Sites is completely useless to me, but CoverFlow for history might come in handy once in a blue moon. Overall it seems like Google Chrome has made quite an impression.

Only one thing REALLY bugging me: keyboard shortcuts for the bookmarks bar is broken for popup bookmarklets.

Ideal behaviour: you hit Cmd-1, and your first (non-folder) item on the bookmarks bar loads in the current window. If it is a JavaScript bookmarklet, it behaves exactly as it would if you’d clicked it, e.g. popup in a new, typically small window. This is not affected by Safari’s Block Pop-up Windows feature.

Safari 3 did exactly that.

Safari 4: you hit Cmd-1, and because Cmd is the modifier for “new tab”, your small bookmarklet opens in a new tab in your large window.

Cmd- for a regular URL bookmark obviously doesn’t open it in a new tab, because the Cmd is part of the shortcut and not the new tab modifier.

I guess nobody on the Safari team uses both popup bookmarklets and shortcut keys for the bookmarks bar.

Update: I think Manton Reece is spot on, regardless of Apple’s intentions (emphasis mine):

In the last 4 years the problem has only gotten worse. Developers are rolling their own tab solutions and there is no consistent behavior or keyboard shortcuts that I have seen. Worse, coding fully-featured tabs with the ability to drag windows in and out of a tab group is very difficult, and most apps don’t go that far.

The Safari 4 tabs are conceptually the right way to go. It’s not “tabs” at all. Instead, think of it as an efficient way to dock multiple windows together.

Virtual Hosts in Leopard (after upgrading from Tiger and still knowing next to nothing about Apache)

Based on this, this and this.

First a note: On Tiger, Apache configs are stored in /etc/httpd. Make a copy of this if you’ve made changes to it on Tiger, and then just delete the folder to avoid future confusion. On Leopard they’ve moved to /etc/apache2/.

Open /etc/apache2/httpd.conf and:
Uncomment (remove the # from) line 461 so it reads Include /private/etc/apache2/extra/httpd-vhosts.conf.
Save and close /etc/apache2/httpd.conf.

Now open /etc/apache2/extra/httpd-vhosts.conf.
Make sure line 19, NameVirtualHost *:80, isn’t commented.
Comment or remove both VirtualHost example blocks at the end (everything from <VirtualHost *:80> to </VirtualHost>.
Save and close /etc/apache2/extra/httpd-vhosts.conf.

Next open /etc/apache2/users/YOURUSERNAME.conf, or create it if it doesn’t exist. YOURUSERNAME is the short name as seen in your home directory.
Copy and paste the following:

<Directory "/Users/YOURUSERNAME/Sites/">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<VirtualHost *:80>
    DocumentRoot "/Users/YOURUSERNAME/Sites"
    ServerName localhost
</VirtualHost>

If you want additional virtual hosts just add another block. For example I have a local WordPress installation that I want to access by simply typing “wp” in Safari:

<VirtualHost *:80>
    DocumentRoot "/Users/justin/Sites/wordpress"
    ServerName wp
</VirtualHost>

Save and close /etc/apache2/users/YOURUSERNAME.conf.

Lastly you need to add your virtual host names to /etc/hosts. It probably looks like this:

127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost

Add one line for each additional virtual host. For me that would be just 127.0.0.1 wp.

Turn Web Sharing off and on again from System Preferences > Sharing and you’re good to go.

I’ll be writing another one about running WordPress locally.