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
// 2012/07/21 irof 修正開始 | |
//// 2012/07/21 削除開始 | |
//// // 間違ったコメント | |
//// 2012/07/21 削除終了 | |
// 2012/07/21 irof 削除開始 | |
// // 間違ったコメント | |
// 2012/07/21 irof 削除終了 | |
// 2012/07/21 irof 修正終了 | |
someMethod(arg); |
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
git init | |
echo a>A.txt | |
git add A.txt | |
git commit -m'A' | |
echo b>B.txt | |
git add B.txt | |
git commit -m'B' |
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.io.ByteArrayOutputStream; | |
import java.io.PrintStream; | |
import org.junit.rules.MethodRule; | |
import org.junit.runners.model.FrameworkMethod; | |
import org.junit.runners.model.Statement; | |
public class SystemOutRule implements MethodRule { | |
private ByteArrayOutputStream baos; |
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
System.setOut(new PrintStream(new OutputStream() { | |
@Override | |
public void write(int b) throws IOException { | |
throw new RuntimeException("Assert使え(#゚Д゚)ゴルァ!!"); | |
} | |
})); |
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 src = new File('src.txt') | |
src.text = 'jggugcamp2011' | |
"chmod 777 src.txt".execute() | |
// readBytes | |
new File('dest.txt') << new File('src.txt').getBytes() |
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
// g100pon #3 リスト操作(上級編) | |
// 1から10まで連番のリストを作成する | |
def list = [*1..10] | |
assert list == [1,2,3,4,5,6,7,8,9,10] | |
// 逆順にする | |
assert list.reverse() == [10,9,8,7,6,5,4,3,2,1] | |
// 後ろから5個とりだす |
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 file = new File('./outout.html') | |
String.metaClass.each = { Closure c -> c(delegate) } | |
def map = [ | |
なまえ:'@irof', | |
年齢:'0x10代', | |
生息地:'大阪', | |
しごと:['主にJava','だけど1.4とか…。','超レガシー',], | |
クラスタ?:['関西ジャバエンジニアの会','TDDBC'], | |
Groovy:['@kiy0takaさんに釣られて…','けどあまり使えてませんorz'], |
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
(1..100).each{i->println i%15?i%5?i%3?i:'Fizz':'Buzz':'FizzBuzz'} |
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 hoge(String... args) { | |
def i = -1, v = '' | |
while(++i < args*.size().min() && args.every{it[i] == args[0][i]}) { | |
v += args[0][i] | |
} | |
args*.minus(v) | |
} | |
assert hoge('123', '123') == ['',''] | |
assert hoge('112233', '123123') == ['12233', '23123'] |
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 javafx.animation.Timeline; | |
import javafx.scene.effect.BoxBlur | |
import javafx.scene.paint.Color; | |
import javafx.scene.shape.StrokeType; | |
import groovyx.javafx.GroovyFX; | |
import groovyx.javafx.SceneGraphBuilder; | |
import groovyx.javafx.TimelineBuilder; | |
GroovyFX.start {stage-> |