Skip to content

Instantly share code, notes, and snippets.

View sbglasius's full-sized avatar

Søren Berg Glasius sbglasius

View GitHub Profile
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / external_configuration_in_grails_3.md
Last active September 23, 2019 09:19
Enable external configuration in Grails 3

External configuration in Grails 3


Working on Grails 3 I realized that I no longer can specify external configuration using the standard grails.config.locations property in Config.groovy file.

Reason is obvious! There is no Config.groovy now in Grails 3. Instead we now use application.yml to configure the properties. However, you can't specify the external configuration using this file too!

What the hack?

Now Grails 3 uses Spring's property source concept. To enable external config file to work we need to do something extra now.

@danieldbower
danieldbower / ClipboardUtils.groovy
Created May 31, 2012 18:31
Working with the System Clipboard from Groovy
import java.awt.datatransfer.StringSelection
import java.awt.Toolkit
import java.awt.datatransfer.*
class ClipboardUtils{
static final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
static void setClipboardContents(final String contents){
clipboard.setContents(new StringSelection(contents), null)
}