Skip to content

Instantly share code, notes, and snippets.

@erikerlandson
erikerlandson / demo.txt
Last active March 22, 2017 13:23
Function that returns a human readable string that describes the type of its argument
scala> import TypeString._
import TypeString._
scala> typeString[Int]
res1: String = Int
scala> typeString(2)
res2: String = Int
scala> typeString[String => Int]
@Alien2150
Alien2150 / gist:d0c74d99c19df59109ff
Created December 19, 2014 16:50
TLS Example with Reactive Streams
package connection
import java.net.InetSocketAddress
import java.security.{SecureRandom, KeyStore}
import javax.net.ssl.{TrustManagerFactory, KeyManagerFactory, SSLContext}
import akka.actor.Actor.Receive
import akka.stream.FlowMaterializer
import akka.stream.actor.ActorPublisherMessage.Request
import akka.stream.actor.ActorSubscriberMessage.{OnComplete, OnNext}
@torao
torao / HowToUseSelfSignedCert.scala
Last active January 30, 2018 08:41
Scala と Java で自己署名証明書を使用したクライアント/サーバ認証 (SSL) のサンプルコード / A sample code to authenticate with self-signed certificate on Scala and Java. http://koiroha.blogspot.jp/2013/11/how-to-use-sslsocket-with-selfsigned-certificates-on-scala-or-java.html
/*
* Copyright (c) 2013 koiroha.org.
* All sources and related resources are available under Apache License 2.0.
* http://www.apache.org/licenses/LICENSE-2.0.html
*/
import java.io._
import java.security.KeyStore
import java.util.Date
import javax.net.ssl._
import scala.concurrent.duration.Duration