Archive of published articles on February, 2009

Back home

SelectorGadget makes CSS selectors really simple

2009/02/26

Today I’ve run across a few mentions of SelectorGadget. First when John Resig tweeted about it and now it’s at the top of Hacker News.

It’s worth all the attention it’s getting. It makes working with CSS selectors, and especially scraping websites, dead simple. This is the gateway into

The kind of information that it gives you can be fed into jQuery (or other CSS selector aware API’s like nokogiri or hpricot for Ruby or beautiful soup for Python) to easily get the right syntax for querying the DOM.

Check out the author’s screencast on the front page. He very quickly demonstrates how easy it is to use SelectorGadget to modify the scope of the intended selector.

P.S. if anyone is aware of any Groovy/Java parsers that can take CSS 3 selectors, I’d love to hear about them. Some quick googling isn’t showing anything.

2 Comments

Patch groovy to allow overriding of font size + height/width of console

2009/02/8

I’ve just opened JIRA issue with a patch to enhance the groovy and grails consoles so that the default font size and the dimensions of the input and output areas can be overridden.

The initial patch I submitted used a custom GroovyConfig file, but at the suggestion of Guillame, I’ve modified the patch to use the preferences API. In my initial poke through the code, I didn’t see the preferences API being used (and couldn’t remember any settings that were saved by the console). After a closer look, it was being used in a couple of places.

The updated patch has been accepted and scheduled for inclusion in Groovy 1.6.1.

If you’re interested in making sure this change gets in, please vote for the JIRA.

I know that I open a groovy or grails console probably 10 times on an average day of programming, and the first thing that I do every time is to hit cmd-shift-L 3 times to bump the font size up to 18 points (yes, my eyes aren’t that great and I’m running my monitor at 1920×1200). The next thing that I do is drag it from the postage stamp size that it defaults to to cover at least half my screen.

This patch will probably save me more frustration than time, but I’m hoping it’ll save a lot of both for others out there.

This change won’t get in till 1.6.1, so if you want to tweak your current groovy install, it’s actually pretty easy to do.
Read the rest of this article »

1 Comment