Wednesday, April 26, 2006

Setup Rails

I always seem to miss a step when installing Rails on Fedora. Here are the steps:

Setup Rails (all steps as root)
Install optional Ruby packages:
- ruby-rdoc
- ruby-ri

Download and install Ruby Gems:
- wget
- Extract archive and change into directory
- ruby setup.rb

Install Rails:
- gem install rails --include-dependencies

Installing Postgres support:
- yum install postgresql-devel
- gem install postgres

Wednesday, April 19, 2006

Firefox View Source Trick

I might be the last one on the planet to discover this one, but I doubt it, so I thought I'd share.

I'm used to right-clicking on a page and selecting "View Page Source" from the context menu. This has some advantages over the same command in the View menu because it allows you to narrow down which frame you want to view.

Last night, however, I accidentally selected some text and right clicked. I noticed that the familiar "View Page Source" menu item had changed to a "View Selection Source". It seems that if an straight-forward subset of the document is spanned by the selection, the resulting view source window will only display that portion. If, however, the selection spans disjoint elements in the tree, the whole document will be displayed with the relevant pieces hilighted.

This in and of itself is really helpful for comprehending a complex HTML structure, but there is one more thing I noticed that is even better:

The output of the View Selection Source command seems to be the HTML representation of the current structure of the document as opposed to the raw text obtained at page load time. Put another way, the changes made via JavaScript to the HTML DOM are displayed by View Selection Source.

I know there is an extension that lets you view the live document structure but I've never installed it and this is an easy trick that seemingly produces the same result.