2013

Temacos traducidos: John Mayer - Stop This Train

Aunque en Europa no es especialmente conocido (al menos que yo sepa, igual es sólo en España o que yo vivo en una burbuja, que también puede ser :-D ), John Mayer parece que es toda una celebridad en USA. Yo, para variar, lo conocí por recomendación de mi hermano (que, por cierto, aprovecho para […]

Grails - Quickly examine a domain class associations

When your Grails model gets a bit complex, you may find yourself with conflicts in your domain classes associations (I like some parts of GORM, such as dynamic finders, but I think the relationships stuff could be improved). In my case, I usually end up finding problems when I mix inheritance and different relationships between […]

Groovy - Simplest way of resolving a nested property

So let's say that in Groovy you find yourself wanting to do something like this: [ 'name', 'lastName', 'address.street'].collect { propertyToResolve -> [(propertyToResolve): user[property] } You will find that the automatic getter (using it with the map syntax or as a property doesn't change anything) won't parse the argument to resolve the property in the […]

New Grails plugin - Timestamped

A Grails plugin to inject the auto-timestamp properties using a configurable, joda-time compatible AST transform that can be used both by a project and by other plugins.

Grails - small and simple method to convert objects to JSON

I was playing around with Grails and JSON and came up with a small method to convert a given collection of objects into JSON (typically, domain class objects, but it would work with anything). It's nothing new or fancy, but maybe usefull for anybody who is starting to explore Grails JSON capabilities. For the sake […]

Bash - find directories of certain sizes

I often find myself trying to know which directories are consuming most of my persistent memory (I would say hard disk, but it isn't a disk - and probably, even hard - anymore), and always get disappointed with myself for not being able to remember the way to do it in the terminal :) . […]