This file contains 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
<html> | |
<head><title>Counter</title></head> | |
<body> | |
<h2>Counter</h2> | |
<h1>{{hook.output}}</h1> | |
</body> | |
</html> |
This file contains 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
// TRYING TO FIGURE OUT WHAT I'M DOING WRONG | |
/* | |
DOMAINS: | |
class Type { | |
String code | |
} | |
class Parent { | |
String name |
This file contains 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 eval = { | |
def binding = new Binding(app:grailsApplication,request:request,session:session,controller:this) | |
def result | |
try { result = params.script ? new GroovyShell(binding).evaluate(params.script) : '(no script)' } | |
catch (e) { result = e.message } | |
result = result instanceof Map ? result.collect{"$it.key: $it.value"}.join('\n') : | |
result instanceof Iterable ? result.join('\n') : result | |
render """${g.form(action:'eval',method:'POST') { | |
"${g.textArea(name:'script',value:params.script,cols:80,rows:10)}${g.submitButton(name:'Submit')}"}} | |
<hr/><pre>${result}</pre>""" |
This file contains 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
@ECHO OFF | |
REM | |
REM Automatic Grails Version Selector v1.0 | |
REM | |
REM Description: | |
REM Automatically selects version of Grails to run based either | |
REM on context, environment variable, or command line argument. | |
REM | |
REM Copyright © 2010, Componentix (http://www.componentix.com/) |
This file contains 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 lazy = { {w->w<<it()}.asWritable() } | |
def x = "it is now ${System.currentTimeMillis()}" | |
def y = "it is now ${{it->it<<System.currentTimeMillis()}.asWritable()}" | |
def z = "it is now ${lazy{System.currentTimeMillis()}}" | |
// change to x,y,z - x prints the same number all 5 times | |
(1..5).each { println z; sleep 250 } |
This file contains 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
-cp `echo *.jar lib/*.jar | sed 's/ /:/g'` |
This file contains 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 block | |
def player | |
def map = [door1: [x: 1, y: 2, z: 3, owner:'krsbuilt'], door2: [x: 4, y: 5, z: 6]] | |
def found = map.find{ k,v -> v.x == block.x && v.y == block.y && v.z == block.z } | |
if (found) { | |
if (found.value.owner != player.name) { | |
// cancel action | |
} |
This file contains 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
#!/bin/sh | |
proj="" | |
port=8091 | |
function testUnit { | |
echo "Starting $1 unit tests for $proj" | |
grails test-app -unit $1 | |
return $? | |
} |