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
git log --pretty=format:'%h by %an message: %s' |
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
#!/usr/bin/env groovy | |
@Grab(group='commons-lang', module='commons-lang', version='2.5') | |
@Grab(group='net.sf.ezmorph', module='ezmorph', version='1.0.6') | |
@Grab(group='commons-collections', module='commons-collections', version='3.2.1') | |
@Grab(group='commons-beanutils', module='commons-beanutils', version='1.8.3') | |
@Grab('net.sf.json-lib:json-lib:2.3-jdk15') | |
import net.sf.json.* | |
def cli = new CliBuilder(usage:'del2scrumptious.groovy') |
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
includeTargets << grailsScript("Init") | |
def tomcatRedeploy(String environment) { | |
runTomcatTarget('undeploy', environment) | |
runTomcatTarget('deploy', environment) | |
} | |
def runTomcatTarget(String target, String environment) { | |
def proc = ['grails', "-Dgrails.env=$environment", 'tomcat', target].execute() | |
proc.consumeProcessOutput System.out, System.err |
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 fileNames = '''groovycsv-0.2-javadoc.jar.asc | |
groovycsv-0.2-javadoc.jar.asc | |
groovycsv-0.2-sources.jar.asc | |
groovycsv-0.2.ear.asc'''.split("\n") | |
def project = new Expando() | |
project.name = 'groovycsv' | |
def version='0.2' | |
def findClassifierPattern = /$project.name-$version(?:-(.+))?\.(\w+\.asc)/ |
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 org.gradle.api.internal.artifacts.publish.* | |
apply plugin: 'groovy' | |
apply plugin: 'maven' | |
repositories { | |
mavenCentral() | |
mavenRepo urls: "http://m2repo.spockframework.org/snapshots" | |
} |
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
javascript:window.open('about:blank') |
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
#!/usr/bin/env groovy | |
// Validating arguments | |
assert args.size() == 1 : "mp4it takes 1 argument: the path to the file to be conerted into mp4" | |
assert new File(args[0]).exists() : "The file you specified could not be found." | |
def videoFilePath = args[0] | |
def outputFilePath = videoFilePath.replaceAll(/\.avi$/, '.mp4') | |
assert !new File(outputFilePath).exists() |
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
// Impl of a lazyCollect method that will not execute | |
// until you actually ask for the value | |
class LazyCollectList extends AbstractList { | |
private Closure collectClosure | |
private List backingList | |
private Map cached = [:] | |
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 Runtime Exception | |
Error Details | |
Error 500: Executing action [show] of controller [org.weceem.controllers.WcmContentController] in plugin [weceem] caused exception: groovy.lang.MissingMethodException: No signature of method: org.weceem.services.WcmContentRepositoryService.resolveSpaceAndURI() is applicable for argument types: ([Ljava.lang.String;) values: [[/views/search-results, /]] Possible solutions: resolveSpaceAndURI(java.lang.String) | |
Servlet: grails | |
URI: /try-weceem/grails/wcmContent/show.dispatch | |
Exception Message: No signature of method: org.weceem.services.WcmContentRepositoryService.resolveSpaceAndURI() is applicable for argument types: ([Ljava.lang.String;) values: [[/views/search-results, /]] Possible solutions: resolveSpaceAndURI(java.lang.String) | |
Caused by: No signature of method: org.weceem.services.WcmContentRepositoryService.resolveSpaceAndURI() is applicable for argument types: ([Ljava.lang.String;) values: [[/views/search-results, /]] Possible solutions: resolveSpaceAndURI(java.lan |
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
// Example of using groupBy and collect together | |
def values = | |
[[lastname: "Anderson", age: 30], | |
[lastname: 'Bergstrom', age: 24], | |
[lastname: 'Anderson', age: 45], | |
[lastname: 'Bergstrom', age: 40], | |
[lastname: 'Brown', age: 25]] | |
// Find average age by lastname: |