This file contains hidden or 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
| #!/bin/bash | |
| cat << EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <link rel="selenium.base" href="http://rakuten.kobobooks.com/" /> | |
| <title>one_buy</title> |
This file contains hidden or 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 scalas | |
| /*** | |
| scalaVersion := "2.10.3" | |
| libraryDependencies ++= Seq( | |
| "org.scalaz" %% "scalaz-core" % "7.0.5" | |
| ,"org.typelevel" %% "scalaz-contrib-210" % "0.1.5" | |
| ,"com.typesafe.akka" %% "akka-actor" % "2.2.3" | |
| ,"com.github.scala-incubator.io" %% "scala-io-core" % "0.4.2" |
This file contains hidden or 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 VendingMachine(total: Int, stock: Map[Drink, Int]) |
This file contains hidden or 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
| #!/bin/bash | |
| cp conf/__application.conf.tmp conf/application.conf | |
| rm conf/__application.conf.tmp |
This file contains hidden or 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
| #!/bin/bash | |
| STATUS=`screen -ls` | |
| new_session() { | |
| exec screen | |
| } | |
| detach_and_reattach() { | |
| exec screen -d -r |
This file contains hidden or 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 dispatch._ | |
| import com.ning.http.client.filter.{ ResponseFilter, FilterContext } | |
| import scala.collection.JavaConverters._ | |
| val MyHttp = Http.configure { builder => | |
| builder.addResponseFilter(new ResponseFilter { | |
| override def filter(ctx: FilterContext[_]) = { | |
| ctx.getResponseHeaders.getHeaders.get("Content-Type").asScala.toList match { | |
| case "text/html" :: Nil => | |
| ctx.getResponseHeaders.getHeaders.put("Content-Type", List("text/html; charset=utf-8").asJava) |
This file contains hidden or 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 org.nisshiee.vendingmachine | |
| case class Juice(name: String, price: Int) | |
| object Juice { | |
| val coke = Juice("コーラ", 120) | |
| val redbull = Juice("Red Bull", 200) | |
| } |
This file contains hidden or 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 apply[S, A](f: (S) ⇒ (S, A)): State[S, A] |
This file contains hidden or 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 akka.actor._ | |
| trait AbstractActor[MesType] extends Actor { | |
| override def receive = ... | |
| } | |
| case class MyMessage(mes: String) | |
| class MyActor extends AbstractActor[MyMessage] |
This file contains hidden or 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 akka.actor._ | |
| class VarCounter extends Actor { | |
| private[this] var count: Int = 0 | |
| override def receive = { | |
| case _: String => count = count + 1 | |
| } | |
| } |