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 main | |
| import ( | |
| "crypto/md5" | |
| "errors" | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "path/filepath" | |
| "sort" |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 jp.sudix.finagle.benchmark | |
| import com.twitter.finagle.Service | |
| import com.twitter.finagle.http.Http | |
| import com.twitter.util.Future | |
| import com.twitter.finagle.builder.ServerBuilder | |
| import org.jboss.netty.handler.codec.http.{DefaultHttpResponse, HttpVersion, HttpResponseStatus, HttpRequest, HttpResponse} | |
| import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer | |
| import java.net.{SocketAddress, InetSocketAddress} |
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
| //close automatically after use | |
| //How to use | |
| //import Control.using | |
| //using(someDbConnection1, someDbConnection2) {(db1, db2) => | |
| // doSomething(db1, db2) | |
| //} | |
| object Control { | |
| type T = {def close(): Unit} |
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 net.rubyeye.xmemcached._ | |
| object Memcache { | |
| def apply(host: String, port: Int): Memcache = { | |
| val mc = new Memcache | |
| mc.connect(host, port) | |
| mc | |
| } | |
| } |
NewerOlder