This file contains 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
$ traceroute lodash.com | |
traceroute to lodash.com (83.137.145.21), 64 hops max, 52 byte packets | |
1 192.168.1.254 (192.168.1.254) 3.152 ms 2.516 ms 2.952 ms | |
2 217.32.147.4 (217.32.147.4) 10.234 ms 12.651 ms 10.333 ms | |
3 217.32.147.46 (217.32.147.46) 12.023 ms 11.620 ms 10.780 ms | |
4 213.120.156.194 (213.120.156.194) 14.348 ms 14.435 ms 13.077 ms | |
5 217.41.168.249 (217.41.168.249) 12.791 ms 12.756 ms 11.999 ms | |
6 217.41.168.109 (217.41.168.109) 12.342 ms 12.376 ms 12.919 ms | |
7 109.159.249.248 (109.159.249.248) 12.970 ms | |
acc2-te0-0-0-20.l-far.21cn-ipp.bt.net (109.159.249.220) 12.824 ms |
This file contains 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
def route = path("foo") { | |
get { | |
complete { | |
println("In foo") // Run on request, not run at start up :-). | |
BodylessHttpResponse(OK) | |
} | |
} | |
} ~ path("bar") { | |
get { | |
println("In bar") // Run at start up, not run on request :-(. |
This file contains 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.io.File | |
import java.util.UUID | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.model.headers.Location | |
import akka.http.scaladsl.model.{HttpEntity, StatusCodes, HttpResponse} | |
import akka.stream.{FlowMaterializer, ActorFlowMaterializer} | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.io._ |
This file contains 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
// With Tie Fighter | |
(validNumberNel(keyJsOpt, _.toLongExact) |@| validNumberNel(valueJsOpt, _.toIntExact)) { | |
case (key, value) => Measurement(name, key, value) | |
} | |
// Without Tie Fighter | |
type V[T] = ValidationNel[String, T] | |
Apply[V].apply2[Long, Int, Measurement](validNumberNel(keyJsOpt, _.toLongExact), validNumberNel(valueJsOpt, _.toIntExact)) { | |
case (key, value) => Measurement(name, key, value) | |
} |
This file contains 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 scalaz._ | |
import Scalaz._ | |
trait WarmUpScalaz { | |
private val warmMeUp = 1.success | |
} |
This file contains 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
#!/bin/bash | |
for i in `seq $1 $2`; do | |
echo Message $i | nc 127.0.0.1 9997 | |
sleep 1 | |
done |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World</title> | |
</head> | |
<body> | |
<script src="node_modules/pixi.js/dist/pixi.min.js"></script> | |
<script src="index.js"></script> | |
</body> |
This file contains 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 io.circe._ | |
import io.circe.parser._ | |
import io.circe.syntax._ | |
import akka.http.scaladsl.marshalling.{Marshaller, ToEntityMarshaller} | |
import akka.http.scaladsl.model.{ContentTypeRange, HttpEntity} | |
import akka.http.scaladsl.model.MediaTypes.`application/json` | |
import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} | |
import scala.concurrent.Future |
This file contains 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
@startuml | |
skinparam monochrome true | |
skinparam classFontSize 16 | |
skinparam classFontStyle "Regular" | |
skinparam classFontName "Gill Sans" | |
skinparam classAttributeFontSize 14 | |
skinparam classAttributeFontStyle "Regular" | |
skinparam classAttributeFontName "Gill Sans" |
This file contains 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 data | |
import cats.Functor | |
import cats.Monad | |
import cats.syntax.either._ | |
final case class EitherOptionT[F[_], A, B](value: F[Either[A, Option[B]]]) { | |
def map[C](f: B => C)(implicit F: Functor[F]): EitherOptionT[F, A, C] = | |
EitherOptionT(F.map(value)(e => e.map(o => o.map(f)))) |
OlderNewer