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 Main { | |
public static void main(String[] args) { | |
// Signal class | |
System.out.println(Signal.class.toString()); | |
// Signal$ class (Signal.type @ Scala) | |
System.out.println(Signal$.class.toString()); | |
// Signal singleton object | |
Signal$ obj = Signal$.MODULE$; |
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
sealed abstract class MailList { | |
// コレクションとして扱うための抽象メソッド | |
def +(mailbox: Mailbox): MailList | |
// 別の型に変換するなどの処理 | |
def publish: String = this match { | |
case Mailbox(str) => str | |
case MailboxList(list) => list.map(_.publish).mkString(",") | |
} | |
} |
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.net.{InetAddress,UnknownHostException} | |
import util.parsing.combinator.RegexParsers | |
object IpParsers extends RegexParsers { | |
def ipAddress: Parser[String] = """[0-9a-fA-F:\.]+""".r.withFilter { str => | |
try { | |
val addr = InetAddress.getByName(str) | |
true | |
} catch { | |
case e: UnknownHostException => false |
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
require 'formula' | |
class Jhcal < Formula | |
homepage 'http://www2.tokai.or.jp/y_okamon/myfreesoft/jhcal/jhcal.html' | |
url 'http://www2.tokai.or.jp/y_okamon/myfreesoft/jhcal/jhcal-2.0.tar.gz' | |
sha1 'ae09d530c3e89da8624245f95378a7991b597101' | |
def install | |
system "make" | |
bin.install "jhcal" |
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 interface A { | |
public static final String C = "hoge"; | |
} |
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
class MyException(message: String = null, cause: Throwable = null) extends RuntimeException(message, cause) { | |
def this(cause: Throwable) = this(Option(cause).map(_.toString).getOrElse(null), cause) | |
} |
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
-gem "redcarpet" | |
+#gem "redcarpet" |
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
FROM debian:7.4 | |
MAINTAINER mather <mather314@gmail.com> | |
RUN apt-get update | |
# SSH Server | |
RUN apt-get install -y openssh-server sudo | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:root' | chpasswd |
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
# -*- coding: utf-8 -*- | |
from fabric.api import * | |
from yaml_loader import load_env_from_yaml | |
load_env_from_yaml('env.yaml', globals()) | |
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 DatabaseComponent { this: Profile => | |
def database: profile.simple.Database | |
} | |
// テスト時 | |
trait H2DatabaseComponent extends DatabaseComponent { | |
import profile.simple._ | |
def database = Database.forURL("jdbc:h2:mem:test") | |
} |
OlderNewer