Updated grails autocomplete script for zsh

2010/03/2

A couple of years ago, I created a grails auto-completion script for bash and zsh.

Since then, I’ve completely abandoned bash, in favor of zsh (which I consider to be the superior shell) and I’d been getting annoyed at a few issues in the last grails autocomplete script.

I finally got motivated to make some enhancements to it. Including support for grails 1.2 plugin scripts (1.2 moved the plugins into the ~/.grails directory), and support for test class name autocompletion (very useful for grails test-app).

To get it working (assuming you’re using zsh), you can either add the contents of my zshrc_grails_compinstall to your .zshrc file, or you can switch over to using my full zshrc setup, which has a number of nice features that I’ve collected over the years. I’ll also continue to update this as I think of new tricks.

After getting it installed, just type “grails” followed by a space and then hit tab. It will show you a list of all of the potential grails scripts for the application that you’re in. It’s aware of the version of the current app, as well as it’s application name based on the contents of application.properties, and also will include any scripts for the plugins you have installed in that app in ~/.grails/GRAILS_VERSION/projects/APP_NAME/plugins (in addition to the scripts in ./scripts, $GRAILS_HOME/scripts and ~/.grails/scripts).

After you choose your script (such as grails test-app hit space again and it will show you all of the test classes, with the full package for the class, under your test directory.

No Comments

Using iWork Numbers.app AppleScript to Sum Columns For All Tables on a Sheet

2010/02/7

Overall, I’m pretty happy with Numbers.app (part of Apple’s iWork suite) as a replacement for Excel. It’s considerably cheaper and has lots of user interface tweaks to make it more pleasant to work with.

One of these changes is that each sheet can actually have multiple tables on it, and these can be arranged independently on the same page. This prevents the problem that happens in excel where you have multiple sets of data you want to see at the same time, but the cell/row sizing for one set of data affects the data in the other set that happens to be on the same row.

I’ve been leveraging this for a one-off personal project and I had a need to sum up all of the data in the 2nd column on all of the tables within a particular sheet.

This brought me to AppleScript, Apple’s scripting language that’s used to drive applications.
Read the rest of this article »

1 Comment

Interrogating Arbitrary Groovy Closures for Values

2010/01/24

Inspired by this question on stackoverflow, I decided to create a utility class that allowed me to determine generically what calls a closure makes (without actually letting it make any calls). This lets me see what it’s trying to do before letting it actually do it.
Read the rest of this article »

4 Comments

Hooking up Hudson to your bitbucket mercurial account

2009/12/21

This past weekend, I saw @wakaleo running into some issues getting bitbucket hooked up to hudson.

I responded with a long reply that I thought would be worth cleaning up and posting here.
Read the rest of this article »

No Comments

Mercurial DVCS DevJam Presentation

2009/11/8

This past week, I gave a presentation to the DevJam meeting on the advantages of using Mercurial, a DVCS (Distributed Version Control System) over tools like Subversion, Perforce, and ClearCase.
Read the rest of this article »

6 Comments

Grails Testing Alias to Rerun Failed Tests

2009/11/3

A while ago I blogged about my grails testing aliases and how much time they save me.

I’ve made some enhancements to them in the interim that have made them even easier to use.

The most important alias is gtaf, which is short for “grails test-app” for failed tests.

It will search through your test output directory and look for any tests that failed. If it finds any, it will rerun only those tests. Otherwise, it will rerun all tests. That makes it easy to just use gtaf all the time. If any tests fail, it will open them up using Console.app.

If you’re not on OSX, or would like to use something else to view the failed test logs, just modify the testlog alias to do something different.
Read the rest of this article »

7 Comments

Snow Leopard Shared Printer Job “On Hold: Authentication Required” fix

2009/11/1

I’ve had problems since installing snow leopard with sharing my printer with my wife’s macbook pro.

Whenever she’d try to print, the job would say “On Hold: Authentication Required”. After some fiddling around I found a solution:

  1. Go into System Preferences and go to the Print & Fax panel.
  2. Right click on the printer and choose “Reset Printing System…”. This will remove all of your printers.
  3. Hit the “+” and add the printer back, it should now be reset and have fixed whatever was fubar before.
  4. Click on the “Sharing Preferences” button (or go to the “Sharing” System Preference panel)
  5. Make sure that “Printer Sharing” is checked and that your printer’s name is also checked and that “Everyone” is set to “Can Print”
  6. On the remote machine you want to remove the printer and add it back in through the System Preferences Print & Fax panel

(This is on 10.6.1, not sure if this works in 10.6.0 (where I first had the problem), you should update to the latest).

After doing all that, I was able to print from my remote computers without any problems or any issues around authentication.

25 Comments

Grails Markdown Plugin 0.1 Released

2009/10/6

I’ve just released a quick plugin that I put together tonight to help render markdown text as HTML within a grails application. It leverages the MarkdownJ library.

I’m a big fan of storing information in markdown format as it is easy to read, easy to write, and easy to transform. A number of big websites like stackoverflow.com support the entry and display of markdown text to help people format their questions and answers without having to remember to properly format HTML.

If you’re unfamiliar with Markdown there are a number of good references on it’s use.

The grails markdown plugin is a very basic plugin. Currently, it just wraps the markdown libarary with a single TagLib that lets you easily render html from a markdown string within your gsp pages.

To install it, just type:

grails install-plugin markdown

To use it in your gsp file:

<markdown:renderHtml>
The *four* cardinal directions are
 
- North
- South
- East
- West
</markdown:renderHtml>

renders the html:

<p>The <em>four</em> cardinal directions are</p>
<ul>
    <li>North</li>
    <li>South</li>
    <li>East</li>
    <li>West</li>
</ul>

Or you can use the “text” attribute of the taglib:

<markdown:renderHtml text="${post.body}"/>

See the Grails Markdown Wiki and source for more details.


3 Comments

Batch Import Performance with Grails and MySQL

2009/10/1

I’ve spent some time over the last couple of weeks working on a Grails service that allows us to import new records into our MySQL database.

A number of interesting techniques have popped out of this that I think would be useful for others doing similar types of importing using GORM/Hibernate/MySQL. Read the rest of this article »

29 Comments

Updated wordpress

2009/09/6

I’ve just switched hosting providers from slicehost to a reserved EC2 instance. I also upgraded from a really old version of wordpress to wordpress 2.8.4. I’ve been meaning to do this for a while now, but wanting to avoid yesterday’s worm prompted me to do it this weekend rather than next.

Let me know if you see any issues or broken links.

1 Comment