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 java.nio.ByteBuffer | |
| import java.security.MessageDigest | |
| import javax.xml.bind.DatatypeConverter | |
| import akka.actor.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.http.scaladsl.model.HttpMethods.GET | |
| import akka.http.scaladsl.model.{HttpRequest, HttpResponse} | |
| import akka.stream.ActorMaterializer | |
| import akka.stream.scaladsl.{Flow, Keep, Sink} |
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
| ```javascript | |
| { | |
| "title":"Report Properties", | |
| "description":"A JSON Schema describing a Report Properties", | |
| "$schema":"http://json-schema.org/draft-04/schema#", | |
| "type":"object", | |
| "properties":{ | |
| "server":{ | |
| "type":"string", | |
| "description":"URL of JRS instance." |
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
| @js.native | |
| trait Auth extends js.Object { | |
| val byToken: js.UndefOr[LoginWithSSOToken] = js.undefined | |
| val byCredentials: js.UndefOr[LoginWithPlainText] = js.undefined | |
| } | |
| object Auth { | |
| def apply(authType: AuthType): Auth = authType match { | |
| case byToken: LoginWithSSOToken => js.Dynamic.literal(byToken = byToken).asInstanceOf[Auth] | |
| case byCredentials: LoginWithPlainText => js.Dynamic.literal(byCredentials = byCredentials).asInstanceOf[Auth] |
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
| val fun: ((Int, Int)) => Int = (kv: Tuple2[Int, Int]) => kv match { | |
| case (k, v) => k + v | |
| } | |
| val fun1: Function1[Tuple2[Int, Int], Int] = (kv: Tuple2[Int, Int]) => kv match { | |
| case (k, v) => k + v | |
| } | |
| val myMap = Map(1 -> 2, 2 -> 3) | |
| myMap.map(fun) |
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
| trait Named[E] { | |
| val name: String | |
| } | |
| case class EOL() | |
| implicit val namedInt = new Named[Int] { | |
| override val name: String = "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
| ** Working */ | |
| sealed class AB[+A] protected(protected val in: List[A], protected val out: List[A]) | |
| object AB { | |
| class ABC(override protected val in: List[Int], | |
| override protected val out: List[Int]) | |
| extends AB(in, out) | |
| } | |
| /**Not Working*/ | |
| sealed class AB[+A] protected(protected val in: List[A], protected val out: List[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
| Command: | |
| connect\n\n | |
| Response: | |
| Event-Name: CHANNEL_DATA | |
| Core-UUID: d01fd5af-47d1-4cc0-9135-72be72656b21 | |
| FreeSWITCH-Hostname: abdhesh-System-Product-Name | |
| FreeSWITCH-Switchname: abdhesh-System-Product-Name | |
| FreeSWITCH-IPv4: 10.0.0.29 | |
| FreeSWITCH-IPv6: %3A%3A1 |
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 cats.Id | |
| import cats.implicits._ | |
| import freestyle._ | |
| import freestyle.implicits._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.Future | |
| /** | |
| * Created by abdhesh on 05/05/17. |
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 freestyle._ | |
| import freestyle.implicits._ | |
| import freestyle.implicits.interpretAp | |
| import cats.implicits._ | |
| case class ValidationResult(isValid:Boolean, events:List[Event]) | |
| trait Command | |
| case class UnknownCommand(cmd:Any) extends Command | |
| sealed trait Event {val name:String} |