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 java.util.regex.Matcher | |
| import java.util.regex.Pattern | |
| def stopWatch = {c-> | |
| s = System.nanoTime() | |
| c() | |
| def w = System.nanoTime() - s | |
| if(w < 1000000) | |
| "${w / 1000} [microsec]" | |
| else if(w < 1000000000) |
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
| (パターン+)+ |
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
| @Grab(group='postgresql', module='postgresql', version='9.1-901.jdbc4') | |
| @Grab(group='org.codehaus.gpars', module='gpars', version='1.0.0') | |
| import org.postgresql.ds.PGSimpleDataSource; | |
| import groovy.sql.Sql; | |
| /* meta */ | |
| String.metaClass.queryTo = { con -> | |
| def qry = delegate |
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 | |
| # | |
| # Show branch name in Zsh's right prompt | |
| # | |
| autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null | |
| setopt prompt_subst | |
| setopt re_match_pcre | |
| function rprompt-git-submodule-status { | |
| local st color subName name treeTop cdir |
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
| @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.6') | |
| import groovyx.net.http.* | |
| import static groovyx.net.http.ContentType.* | |
| import static groovyx.net.http.Method.* | |
| import javax.net.ssl.X509TrustManager | |
| import javax.net.ssl.SSLContext | |
| import java.security.cert.X509Certificate | |
| import javax.net.ssl.TrustManager |
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: 'java' | |
| apply plugin: 'groovy' | |
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath "net.saliman:gradle-cobertura-plugin:2.0.0" | |
| } |
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
| #!/bin/bash | |
| echo "prepush called" | |
| DIR=$PWD | |
| ROOT=$PWD/`git rev-parse --show-cdup` | |
| ROOT=${ROOT%/} | |
| result=0 | |
| #dryRun |
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 rev-parse --git-dir |
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 relativize = {file-> | |
| projectDir.toURI().relativize(file.toURI()).toString() | |
| } | |
| task(enhance,dependsOn:classes) << { | |
| description 'OpenJPA enhancer task.' | |
| ant.taskdef ( | |
| name : 'openjpac', | |
| classpath : project.runtimeClasspath.asPath, | |
| classname : 'org.apache.openjpa.ant.PCEnhancerTask' |
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 myVar = 'myvar' | |
| def callMyVar() { | |
| println myVar | |
| } | |
| callMyVar() |