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 example.dsl | |
import scala.language.implicitConversions | |
case class Card(number: String, firstName: String, lastName: String) | |
case class User(username: String, email: String) | |
case class AntiFraudInput(card: Card, user: User, amount: Double) |
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
trait PrettyPrinted[A] extends (A => String) | |
object PrettyPrinted { | |
def apply[A](f: A => String): PrettyPrinted[A] = f(_) | |
} | |
trait Printable[A] { | |
implicit def printer: PrettyPrinted[A] | |
} |
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
input { | |
# ... | |
} | |
output { | |
elasticsearch { | |
index => "transactions" | |
document_id => "%{id}" | |
action => update | |
hosts => "es" | |
} |
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 the | |
import org.bson.codecs.configuration.CodecRegistries.fromRegistries | |
import org.mongodb.scala.MongoClient.DEFAULT_CODEC_REGISTRY | |
import org.mongodb.scala.bson.BsonInt64 | |
import org.mongodb.scala.{Document, MongoClient} | |
import scala.concurrent.Await | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration._ |
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
// https://stackoverflow.com/questions/65669069/akka-http-validate-path-segment | |
import akka.http.scaladsl.model.Uri.Path | |
import akka.http.scaladsl.server.{Directive, Rejection} | |
import com.exabeam.scheduler.models.AppErrors | |
import org.bson.types.ObjectId | |
final case class MalformedPathParamRejection(parameterName: String, errorMsg: String) extends Rejection | |
object ValidatedObjectId { |
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
lazy val myProjectClient = (project in file("my-project-client")) | |
.settings(name := "myProjectClient") | |
.settings(commonSettings) | |
.enablePlugins(CustomPlugin) | |
lazy val service = (project in file("service")) | |
.settings(name := "myProjectSvc") | |
.settings(commonSettings) | |
.settings(serviceSettings) | |
.dependsOn(myProjectClient) |
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
// Code example for https://stackoverflow.com/q/66989225/5091346 | |
package com.github.aaabramov | |
import java.time.LocalDateTime | |
object Test extends App { | |
trait TestTrait[A] { |
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
sudo yum update | |
# Installing ZSH | |
sudo yum -y install zsh | |
# Check ZSH has been installed | |
zsh --version | |
# Install "util-linux-user" because "chsh" is not available by default | |
# See https://superuser.com/a/1389273/599050 |
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
# Building layer | |
FROM node:16-alpine as development | |
# Optional NPM automation (auth) token build argument | |
# ARG NPM_TOKEN | |
# Optionally authenticate NPM registry | |
# RUN npm set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
WORKDIR /app |
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
─ | |
━ | |
│ | |
┃ | |
┄ | |
┅ | |
┆ | |
┇ | |
┈ | |
┉ |
OlderNewer