This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object.class.declaredFields.findAll{!it.synthetic}.collectEntries{ [ (it.name):this."$it.name" ] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SimpleEchoServer implements Runnable { | |
| private int port; | |
| private LinkedList<Socket> openClients = new LinkedList<Socket>(); | |
| private boolean cleaningUp = false; | |
| public SimpleEchoServer(int port) { | |
| this.port = port; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // testing groovy DSL | |
| // http://docs.groovy-lang.org/docs/latest/html/documentation/core-domain-specific-languages.html | |
| COMPOSITION = 'COMPOSITION' | |
| // constructor for patient's stuff | |
| def create( what ) | |
| { | |
| [to: { patient -> | |
| switch (what) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * We have two functions with exactly the same code, but one has a filter, so I want to use the same code | |
| * but inject the filter by using a closure: | |
| */ | |
| // Filters | |
| def filter_between = { min, max, n -> | |
| return min < n && n < max | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def nuli = null | |
| def empi = [] | |
| def algi = [1,2,3] | |
| println nuli ?: empi | |
| println nuli ?: algi | |
| println empi ?: algi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Channel { | |
| def id = UUID.randomUUID().toString() // java.util.UUID | |
| def name | |
| def enabled = true | |
| def revision = 1 | |
| def source | |
| def destinations = [] | |
| def preprocessing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum ChangeType { | |
| CREATION(249 as short), | |
| AMENDMENT(250 as short), | |
| MODIFICATION(251 as short), | |
| DELETED(523 as short) | |
| // TODO: SYNTHESIS, ATTESTATION, UNKNOWN? | |
| private final short value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "fields": { | |
| "status": "During Check In" | |
| }, | |
| "required": false, | |
| "name": "Check In", | |
| "complete": true | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| https://stackoverflow.com/questions/7380226/find-word-in-html | |
| */ | |
| function wrapWord(el, word) | |
| { | |
| var expr = new RegExp(word, "i"); | |
| var nodes = [].slice.call(el.childNodes, 0); | |
| for (var i = 0; i < nodes.length; i++) | |
| { | |
| var node = nodes[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hussain.pf | |
| import groovy.xml.MarkupBuilder | |
| import org.apache.commons.lang.StringEscapeUtils | |
| import org.codehaus.groovy.grails.plugins.web.taglib.ValidationTagLib | |
| class CustomValidationTagLib extends ValidationTagLib { | |
| /** |
OlderNewer