Skip to content

Instantly share code, notes, and snippets.

View tototoshi's full-sized avatar

Toshiyuki Takahashi tototoshi

View GitHub Profile
@tototoshi
tototoshi / cowsay
Created July 7, 2012 06:18
cowsay...
$ cowsay 焼肉たべたい
____________________
< 焼肉たべたい >
--------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
$
@tototoshi
tototoshi / app-context.xml
Created July 1, 2012 03:47
spring-python
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.org/springpython/schema/objects/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/springpython/schema/objects/1.1
http://springpython.webfactional.com/schema/context/spring-python-context-1.1.xsd">
<object id="greeting" class="example1.GoodBye" />
</objects>
@tototoshi
tototoshi / GreetingSample.scala
Created June 30, 2012 09:11
Scala + SpringFramework
package com.github.tototoshi.sample
import scala.collection.JavaConversions._
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.AnnotationConfigApplicationContext
@Configuration
class AppConfig {
@tototoshi
tototoshi / build.sbt
Created June 14, 2012 13:56
scopt 2.1.0 お試し
import sbt._
import sbt.Keys._
object EchoBuild extends Build {
lazy val echo = Project(
id = "echo",
base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "echo",
package controllers
import play.api._
import play.api.mvc._
import play.api.http._
import play.api.libs.iteratee._
import play.api.libs.iteratee.Input._
import net.liftweb.json.{ JValue => LiftJValue, _ }
@tototoshi
tototoshi / productFormatUsage.scala
Created May 25, 2012 11:14
productFormatあるよ!
scala> import play.api.libs.json._
import play.api.libs.json._
scala> import play.api.libs.json.Generic._
import play.api.libs.json.Generic._
scala> case class User(id: Long, name: String, age: Int)
defined class User
scala> implicit def userFormat: Format[User] = productFormat3("id", "name", "age")(User.apply)(User.unapply)
@tototoshi
tototoshi / finagle_http_hello.scala
Created May 19, 2012 04:11
finagle-http で Hello, world.
package com.github.tototoshi.finagle_hack
import java.net.InetSocketAddress
import com.twitter.finagle.{Service, SimpleFilter}
import com.twitter.util.Future
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.http._
import com.twitter.finagle.http.path._
object HTTPServer {
@tototoshi
tototoshi / either_20120423.scala
Created April 23, 2012 02:57
地味につらい
/* これはできる */
val o = Some(("foo", 1))
for {
(s, i) <- o
} yield {
println(s)
println(i)
}
@tototoshi
tototoshi / picture_show_test.md
Created April 10, 2012 12:22
picture show test

!SLIDE

Hello

@tototoshi
tototoshi / AfterComposeSpec.scala
Created March 23, 2012 02:11
specs2 で After を合成
import org.specs2.mutable._
class AfterComposeSpec extends Specification {
"Compose After" should {
"after123" in (After1 then After2 then After3){
success
}