Skip to content

Instantly share code, notes, and snippets.

@rintcius
rintcius / HelloBuild.scala
Created September 7, 2012 09:56
Build file that does not publish extra artifacts; see https://github.com/arktekk/sbt-aether-deploy/issues/5
import sbt._
import Keys._
object HelloBuild extends Build {
val mySettings = Seq(
credentials += Credentials(Path.userHome / ".m2" / ".credentials"),
publishTo <<= version {
v: String =>
@rintcius
rintcius / SSL Troubleshooting
Created November 6, 2012 20:34
Container of SSL problems that can occur; possible causes and solutions
Possible causes:
- Truststore not found
- Truststore does not contain the required entry (correctly).
The java library io-webservices-api communicates with https://api.webservices.io and requires a valid public key with this domain in its truststore.
Possible solution:
- Add entry to truststore. See http://webservices.io/ssl
Associated stacktrace:
Exception in thread "main" org.springframework.web.client.ResourceAccessException: I/O error: peer not authenticated; nested exception is javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:461)
@rintcius
rintcius / Public key of api.webservices.io
Created November 7, 2012 00:20
Public key of api.webservices.io (PEM)
-----BEGIN CERTIFICATE-----
MIIHLDCCBhSgAwIBAgIDB7n7MA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMvU3RhcnRDb20gQ2xhc3Mg
MSBQcmltYXJ5IEludGVybWVkaWF0ZSBTZXJ2ZXIgQ0EwHhcNMTIxMDEzMTIyNTI0
WhcNMTMxMDE0MDcwMTAzWjBuMRkwFwYDVQQNExBrZk92cFMxTkxOaWdNNjc4MQsw
CQYDVQQGEwJHQjEbMBkGA1UEAxMSYXBpLndlYnNlcnZpY2VzLmlvMScwJQYJKoZI
hvcNAQkBFhh3ZWJtYXN0ZXJAd2Vic2VydmljZXMuaW8wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCvX5BWpJWj+gm3DaDLY9j3HKlSf0CIftbWUf1LU3r/
32C05DdG5zYAZCksLDHyU1V6MLgsqGosYhocbokxNRLPbJCTsG5pkw0QQ24hwFnl
// =======================
// service interfaces
trait OnOffDevice {
def on: Unit
def off: Unit
}
trait SensorDevice {
def isCoffeePresent: Boolean
}
package com.typesafe.training.hakkyhour
import akka.actor.{ Actor, ActorRef, ActorSystem, Props }
import akka.pattern.{ ask, pipe }
import akka.util.Timeout
import scala.concurrent.{ Future, Await }
import scala.concurrent.duration._
case class DoTask(num: Int)
import annotation._
case class Pronunciation(pronounce: String) extends StaticAnnotation
case class Law(name: String, denotation: String) extends StaticAnnotation
trait ~>[F[_], G[_]] {
def apply[A]: F[A] => G[A]
}
case class Id[A](x: A)
package deiko
import scala.concurrent.Future
import scala.concurrent.duration.Duration
import scalaz.concurrent.Task
import scalaz.stream._
import play.api.libs.iteratee._
import Process._
object Conversion {
import Html
import Html (Html, text)
import Html.Shorthand (..)
blog : Html
blog =
let -- Bootstrap helpers
container = divc "container"
row = divc "row"
col = divc "col-md-9"
@rintcius
rintcius / simple-input
Created February 24, 2015 21:28
Elm experiments
view : Field.Content -> Element
view fieldContent =
flow down
[ Field.field Field.defaultStyle (Signal.send content) "Type here!" fieldContent
, Field.field Field.defaultStyle (Signal.send content) "Type here2!" fieldContent
, plainText (String.reverse fieldContent.string)
]
content : Signal.Channel Field.Content
content = Signal.channel Field.noContent