This file contains 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 array = [] | |
def tmp = "" | |
array = ('0'..'9') + ('a'..'z') + ('A'..'Z') + '_' | |
(1..16).each { | |
tmp += array[Math.floor(Math.random() * array.size()) as int] | |
} | |
println tmp |
This file contains 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
@GrabResolver(name='m.g.o-public', root='http://maven.glassfish.org/content/groups/public/') | |
@Grab('org.jenkins-ci.main:cli:1.398') | |
import hudson.cli.CLI | |
import javax.swing.* | |
import groovy.beans.Bindable | |
import groovy.ui.Console | |
class JenkinsMenuModel { | |
@Bindable String url | |
@Bindable String args = '' |
This file contains 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.security.MessageDigest | |
println "-"*40 | |
println "MessageDigest:" | |
File.metaClass.getMd5 = { | |
MessageDigest.getInstance("md5"). | |
digest(delegate.readBytes()). | |
collect{ String.format("%02x", it) }. | |
join() | |
} |
This file contains 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
// あるプロジェクトの下流ビルドと上流ビルドを取得する方法 | |
// 以下は groovy plugin の Execute system Groovy script の中で使用して | |
// TEST プロジェクトの下流ビルドと上流ビルドを取得する例 | |
def jobname = "TEST" | |
def job = hudson.model.Hudson.instance.getItem(jobname) | |
def dep = hudson.model.Hudson.instance.dependencyGraph | |
assert job, "ERROR: Can't find the job $jobname." | |
assert dep, "ERROR: Can't get the dependency graph." |
This file contains 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 kvmap = [ | |
key1: "value1", | |
key2: "value2", | |
key3: [ | |
"key3-1" : "value3-1", | |
"key3-2" : "value3-2", | |
], | |
] | |
LinkedHashMap.metaClass.toXml = { builder -> |
This file contains 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', module='groovy-xmlrpc', version='0.7') | |
@Grab(group='jivesoftware', module='smack', version='3.1.0') | |
import groovy.net.xmlrpc.XMLRPCServerProxy | |
// 設定内容 | |
def SPACE = 'demo' | |
def USER_ID = 'demo' | |
def PASSWORD = 'demo' |
This file contains 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
@GrabResolver(name='seasar.org', root='http://maven.seasar.org/maven2/') | |
@Grab('net.arnx.jsonic:jsonic:1.2.0') | |
import net.arnx.jsonic.JSON | |
println JSON.encode([ | |
name:'Kiyotaka OKu', | |
tags:['java', 'groovy', 'jenkins'] | |
]) |
This file contains 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
// example1.msgspec | |
namespace com.example | |
namespace cpp example | |
namespace ruby Example | |
message BasicTypeExample { | |
1: int8 f1 | |
2: int16 f2 |
This file contains 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
<?php | |
/* | |
/ >、 | |
厶/vvゝ | |
|| ・_・リ | |
川゚O O゚ | |
`` | |
*/ | |
/* | |
- 定数定義 - |
This file contains 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 node | |
//http://vimeo.com/22429969 | |
var fs = require('fs'); | |
var spawn = require('child_process').spawn; | |
var cap = "/path/to/cap.jpg"; | |
var glt = "/path/to/cap_glitch.jpg"; |