Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo 'convert start.'
noise_option="$1"
if [ -z $noise_option ]; then
noise_option=0
fi
@grimrose
grimrose / convert.sh
Created December 18, 2012 13:01
jpegをアスキーアートに変換する ref: http://qiita.com/items/c8144222abcad84532c7
#!/bin/bash
echo 'convert start.'
noise_option="$1"
if [ -z $noise_option ]; then
noise_option=0
fi
@grimrose
grimrose / MethodExtractExampleGroovyTest.groovy
Created February 3, 2013 15:33
MethodExtractExampleTestをGroovyで書き直すとエラーになる件について
package chapter11
import org.junit.Test
import static org.hamcrest.CoreMatchers.is
import static org.junit.Assert.assertThat
class MethodExtractExampleGroovyTest {
@Test
@grimrose
grimrose / DelegateObjectSampleTest.groovy
Created February 3, 2013 15:42
DelegateObjectSampleTest
package chapter11
import org.junit.Test
import static org.hamcrest.CoreMatchers.*
import static org.junit.Assert.assertThat
class DelegateObjectSampleTest {
@Test
@grimrose
grimrose / EmployeeBean.java
Last active December 12, 2015 02:49
こんな感じのクラスをリファクタリングには?
public class EmployeeBean {
private boolean forManagementMode;
public String getFullName(String userCode) {
Employee employee = findBy(userCode);
if (employee.middleName == null) {
return employee.lastName + " " + employee.firstName;
}
@grimrose
grimrose / TDDBC_Tokyo_2013_03_16.rst
Last active December 15, 2015 00:58
TDDBC東京 2013-03-16運営振り返り

Keep

  • 言語ごとにスケルトンを用意しておくと、それをダウンロードしてからスタート出来る。
    • IDEの違いが一番のネックになってくる。
    • キーバインドが違っているとペアが出来ない可能性がある。
    • GitHubなどで共有するのは妥当な解決策だが、参加者層によっては難しい。
  • 初心者同士のペアを作らないのは、良かった
@grimrose
grimrose / ASTTestFailSample.groovy
Last active December 15, 2015 01:29
ASTTestの実行結果
package ast
import groovy.transform.*
@ASTTest(value = {
def owner = node.declaringClass
assert owner.fields.any { it.name == 'x' }
})
@Field int y
@grimrose
grimrose / charm.groovy
Last active December 16, 2015 21:08
Java 8を関数型っぽく使うためのおまじないをGroovyでやってみた
/*
* http://d.hatena.ne.jp/nowokay/20130501#1367357873
* 上記の記事をGroovyでやってみました。
*/
def enclose = { s -> "[" + s + "]" }
assert "[foo]" == enclose.call("foo")
assert "[foo]" == enclose("foo")
@grimrose
grimrose / build.gradle
Created May 7, 2013 17:10
Copyタスクを使ってdependenciesを振り分ける場合
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.5'
@grimrose
grimrose / build.gradle
Last active December 17, 2015 05:49
『JUnit実践入門』写経・実践会 in 横浜 #6 (特別編) テスト対象となるプロジェクトをGradleでなんとかしてみるbuild.gradle
apply {
plugin 'java'
plugin 'war'
plugin 'jetty'
}
apply plugin: 'maven'
apply {
plugin 'idea'