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
| // My stupid algorithm on Groovy's list reshape: | |
| def reshape = { x, size -> | |
| int j = 0 | |
| def result = [] | |
| def sublist = [] | |
| x.each { | |
| j++ | |
| sublist.add(it) | |
| if(j == size) { |
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
| 0xb3e3bc5f: call 0xb3e0d060 ; OopMap{[16]=Oop [36]=Oop off=3012} | |
| ;*invokedynamic | |
| ; - g7.tests.classgen.Fib::fib@43 | |
| ; - g7.tests.classgen.Fib::fib@33 | |
| ; {optimized virtual_call} | |
| 0xb3e3bc64: mov esp, ebp ;*invokedynamic | |
| ; - g7.tests.classgen.Fib::fib@43 | |
| ; - g7.tests.classgen.Fib::fib@33 | |
| 0xb3e3bc66: mov [esp+0x1C], eax | |
| 0xb3e3bc6a: jmp 0xb3e3bcb4 |
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
| import groovy.util.* | |
| import java.net.* | |
| class HomeController { | |
| def index = { | |
| // | |
| // read input via NekoHTML | |
| // | |
| def p = new XmlParser( new org.cyberneko.html.parsers.SAXParser() ) |
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
| apply plugin: 'groovy' | |
| apply plugin: 'eclipse' | |
| repositories { | |
| mavenCentral() | |
| mavenRepo urls: "http://groovypp.artifactoryonline.com/groovypp/libs-releases-local/" | |
| } | |
| dependencies { | |
| def gppVersion = '0.2.4' |
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
| pushd $PWD | |
| cd $GRAILS_HOME/.. | |
| unlink current | |
| ln -s grails-$1 current | |
| popd |
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
| title "S5: An Introduction" | |
| theme "default" | |
| // header | |
| footer | |
| h1 "S5 Testbed" | |
| h2 "Location / Date" | |
| slide "Abcde" | |
| h1 "S5 Testbed" |
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 Simple { | |
| String name | |
| def propertyMissing(String p) { | |
| return new Simple(name: p) | |
| } | |
| def call(c) { | |
| c.delegate = new FieldCaller() | |
| c.resolveStrategy = Closure.DELEGATE_FIRST | |
| c.call() | |
| } |
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
| grails -Dserver.port=8081 test-app :selenium Issue131 |
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 SQLite { | |
| private JavaScriptObject con; | |
| private String name; | |
| public SQLite(Strig name) { | |
| this.name = name; | |
| init(); | |
| } |
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
| // from: http://adammonsen.com/post/548 | |
| detectMobile (controller:'*', action:'*') { | |
| before = { | |
| if (request.getHeader('user-agent') =~ /(?i)iphone/) { | |
| request['isMobile'] = true | |
| } else { | |
| request['isMobile'] = false | |
| } | |
| return true // keep processing other filters and the action |