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
@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
### 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='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
(パターン+)+ |
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
import java.util.regex.Matcher | |
import java.util.regex.Pattern | |
def stopWatch = {c-> | |
s = System.nanoTime() | |
c() | |
"${(System.nanoTime() - s) / 1000} [microsec]" | |
} | |
Pattern slowp = Pattern.compile(/[^。「」]{30,}/) |
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 getSteps = {start=1,max,step=1000 -> | |
if(max <= start + step) return [[start..max]] | |
def rs = (start..max).step(step).inject([]) {a,c -> (c>start) && a << [ ((a!=[])?a.last().to[0]+1:start)..c-1];a} | |
(rs.last().to[0] != max) && rs << [rs.last().to[0]+1..max];rs | |
} | |
println""" | |
getSteps(max=10020) = ${getSteps(max=10020)} | |
""" | |
println""" |
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
List.metaClass.toString = { squate,equate=null -> | |
if(equate==null) equate = squate | |
delegate.collect {"${squate}${it}${equate}"} | |
} | |
def l = ["a","b","c"]; | |
println l.toString() | |
println l.toString("'") |
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
C:\>echo %path% | perl -nle "s/;/;\n/g;print $_" | |
C:\Program Files (x86)\Haskell\bin; | |
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\lib\extralibs\bin; | |
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\bin; | |
C:\Program Files (x86)\Intel\iCLS Client\; | |
C:\Program Files\Intel\iCLS Client\; | |
%SystemRoot%\system32; | |
%SystemRoot%; | |
%SystemRoot%\System32\Wbem; | |
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; |