ADD nyan /path/to/app/nyan
# /path/to/app/nyan --conf=$conf みたいな事が書いてある
ADD app.conf /etc/init/app.conf
CMD ["/sbin/init"]
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
public class TypeClass { | |
interface Addable<T> { | |
T add(T a, T b); | |
} | |
public static class IntAdd implements Addable<Integer> { | |
@Override | |
public Integer add(Integer a, Integer b) { | |
return a + 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
public class ListTest { | |
public static class WhenListHasElements{ | |
@Test | |
public void shouldIndicatesNotEmpty() throws Exception { | |
//snip | |
} | |
} | |
public static class WhenListHasNoElements { |
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.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.text.Normalizer; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Random; | |
import static Janken.Utility.*; |
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
public class Stream { | |
public static void main(String[] args) { | |
Optional<String> result = Optional.empty(); | |
for(String lang : Arrays.asList("C++", "Go", "Java", "Python", "Ruby")){ | |
String _lang = lang.toUpperCase(); | |
System.out.println("toUppercase(" + _lang + ")"); | |
System.out.println("length(" + _lang + ")"); | |
if(_lang.length() == 4){ |
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
trait DocchiGaDaiji[A, B] { | |
def docchi(a: A, b: B): Either[A, B] | |
} | |
object WatashiToShigoto { | |
case class Watashi | |
case class Shigoto | |
implicit object WatashiToShigotoDocchigaDaiji extends DocchiGaDaiji[Watashi, Shigoto]{ |
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
public class Hoge { | |
public static void main(String[] args) throws Exception { | |
Hoge hoge = new Hoge(); | |
System.out.println(hoge.doHoge()); | |
return; | |
} | |
public int doHoge(){ | |
final int a = 1; | |
final int b = 1; |
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
package acceptance; | |
import java.net.URL; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Hoge { | |
static interface ToString<T> { | |
String str(T t); |
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 org.specs2.mutable._ | |
class HogeSpec extends Specification { | |
step { | |
println("start") | |
} | |
"hoge" should { | |
"huga" in { /*ry*/ } |
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
case class Hoge(id: String) | |
object HogeTable extends SQLSyntaxSupport[Hoge]{ | |
//ry | |
} | |
//これだとh.idのコンパイルが失敗する | |
def doSomething() = { | |
findOther.right.flatMap { result => //Eitherを返すDB処理 | |
val h = HogeTable.syntax("h") | |
withSQL { |
NewerOlder