Quantcast
Browsing all 19 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Bash – How to dynamically evaluate and set a variable

One of the things that opens the gate to truly code reusation in Bash is, in my opinion, the hability of evaluate and set variables in a dynamic way. By dynamic, I mean that the variable name is...

View Article


Image may be NSFW.
Clik here to view.

Grails – generic methods for equals and hashCode calculation

In modern versions of Grails, you can use the Groovy annotation EqualsAndHashCode for generating the equals and hashCode methods of your domain classes using an AST transformation, but if you are in...

View Article


Image may be NSFW.
Clik here to view.

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...

View Article

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...

View Article

Image may be NSFW.
Clik here to view.

New Grails plugin – Timestamped

Plugin URL: grails.org/plugin/timestamped Plugin documentation: deigote.github.io/grails-timestamped/guide/single.html Demo project with integration tests: github.com/deigote/TimestampedDemo I...

View Article


Image may be NSFW.
Clik here to view.

Grails – publish a plugin in a self-hosted maven repository

Context and motivations Since a few versions ago, grails includes the possibility of packaging your plugin as an old good JAR file. This can be done by using the –binary option: grails-timestamped $...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article


Image may be NSFW.
Clik here to view.

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 ), John Mayer parece que es toda una celebridad en USA....

View Article


Image may be NSFW.
Clik here to view.

Grails – my domain class instance says its class is abstract!

I recently faced a weird problem when using Grails and a domain class hierarchy that contained abstract classes, let’s say: abstract class A { ...} abstract class B extends C { ...} class C extends A {...

View Article

Image may be NSFW.
Clik here to view.

Grails – query or criteria against a string/value pairs map property

Grails has a feature that I find sometimes useful: mapping a simple map of string/value pairs using GORM. That is, given a domain class, if you create a property whose type is Map, and the name of the...

View Article

Image may be NSFW.
Clik here to view.

Grails – Is my bean a singleton?

At an interesting discussion about how to bulk-delete objects in Grails, I suggested using the sessionFactory bean to explicitly flush the session when required. One of the participants was concerned...

View Article

Image may be NSFW.
Clik here to view.

Fish shell – using modules to import functions

I recently decided to give fish shell a try. I’ve always been reluctant to change my shell: bash has certainly its flaws, but it is widely spread. But lately I’m trying to go easier on embracing new...

View Article


Image may be NSFW.
Clik here to view.

Grails – No such property for class:...

Behind that obscure title lies a problem that I recently had with Grails and that consumed half of my morning. The solution was rather simple but finding it was hard for me (although once it has...

View Article

Image may be NSFW.
Clik here to view.

Grails – Hibernate-safe domain class property editor

Grails automatic databinding is super powerful, but, at least in versions 2.2.x and below, is rather obscure and not very-well documented. Sometimes is not clear how a form input should be named...

View Article


Image may be NSFW.
Clik here to view.

Dropbox in docker

I was thinking of an easy way to backup the wp-content directory of my two blogs (the other one being Una Cerveza Al Día ) and Dropbox came to my mind: my space requirements are very modest, even for...

View Article

Gmail Sender – send emails from the command line

I had an itch that needed to be scratched already – in a couple of servers I maintain I had to send a few emails from some scripts, and having to install an SMTP server seemed like an overkill – one...

View Article


Feed My Files – build a feed from your filesystem

If for whatever reason you need to keep track of the new files being created on a remote filesystem, Feed My Files is your tool. It allows you to create a feed from a given path of the filesystem, and...

View Article

Human readable to camel case in Scala

After searching for a simple way to convert a string like I am a nice string (human friendly) into something like IAmANiceString (camel-case) and finding formulas only for the opposite, I decided to...

View Article
Browsing all 19 articles
Browse latest View live