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
new File("src").eachDirRecurse { | |
it.eachFile { | |
if (it.isFile()) { | |
def s = "${it.readLines().join("\n")}\n" | |
BufferedWriter w = it.newWriter("UTF-8") | |
w.write(s) | |
w.flush() | |
} | |
} | |
} |
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
ant.fixcrlf(srcdir:"src", eol:"lf") |
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='joda-time', module='joda-time', version='*') | |
import org.joda.time.* | |
DateTime.metaClass.random ={t-> | |
def range = Days.daysBetween(delegate, new DateTime(t)).getDays() + 1 | |
delegate.plusDays(Math.floor(Math.random() * range) as int).toString("yyyy-MM-dd") | |
} | |
5.times{ | |
println new DateTime("1978-09-30").random("2011-10-10") |
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
defaultTasks 'ftp' | |
repositories{ | |
flatDir(dirs:["lib"]) | |
} | |
configurations { | |
ftpAntTask | |
} | |
dependencies { |
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
String.metaClass.multiply = {String s -> | |
delegate+s | |
} | |
List.metaClass.multiply = { List l -> | |
result = [] | |
delegate.each{e1 -> | |
l.each{e2 -> | |
result << e1*e2 | |
} | |
} |
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.*; | |
public class Main { | |
public static void main(String... a){ | |
HashMap<String, Integer> m = map($("hoge1",1),$("hoge2",2)); | |
System.out.println(m); | |
ArrayList<String> l = list("hoge","fuga"); | |
System.out.println(l); | |
} |
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 com.sun.net.httpserver.HttpExchange | |
import com.sun.net.httpserver.HttpHandler | |
import com.sun.net.httpserver.HttpServer | |
import groovy.xml.MarkupBuilder | |
def PORT = 6001 | |
HttpServer server = HttpServer.create(new InetSocketAddress(PORT), 0); | |
server.createContext("/", new HttpHandler() { | |
@Override | |
public void handle(HttpExchange he) throws IOException { |
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
//Jenkins起動スクリプトです。 | |
//環境変数にJENKINS_HOMEを指定する必要があります。 | |
//また、jenkins.warはJENKINS_HOME配下にあるものとして使われています。 | |
if(!System.getenv("JENKINS_HOME")){ | |
println "Please Set 'JENKINS_HOME'" | |
return | |
} | |
if(!new File("${System.getenv("JENKINS_HOME")}/jenkins.war").exists()){ | |
println "Please Confilm ${System.getenv("JENKINS_HOME")}/jenkins.war" | |
return |
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
/** | |
* Created with IntelliJ IDEA. | |
* User: m_arino | |
* Date: 12/05/18 | |
* Time: 11:10 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
(0..100).each { | |
def printBuff = "" |
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 root = new File("./src/") | |
println root.absolutePath | |
lastmodified = [:] | |
current = [:] | |
while(true){ | |
current.clear() | |
root.eachFileRecurse { | |
current << ["${it.absolutePath}":it.lastModified()] | |
} | |
if(!current.equals(lastmodified)){ |
OlderNewer