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
// Copy JVM ssl settings to be used by gatling | |
val systemProps = new SystemProperties | |
javaOptions in Runtime ++= Seq( | |
mirrorProperty("javax.net.ssl.trustStore", "gatling.http.ssl.trustStore.file"), | |
mirrorProperty("javax.net.ssl.trustStorePassword", "gatling.http.ssl.trustStore.password"), | |
mirrorProperty("javax.net.ssl.keyStore", "gatling.http.ssl.keyStore.file"), | |
mirrorProperty("javax.net.ssl.keyStoreType", "gatling.http.ssl.keyStore.type"), | |
mirrorProperty("javax.net.ssl.keyStorePassword", "gatling.http.ssl.keyStore.password") | |
).flatten |
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 | |
set -uxe | |
# Runs a redis instance, and connects via redis-cli | |
docker stop redis-playground || true | |
docker rm redis-playground || true | |
docker run --name redis-playground -d redis | |
exec docker run -it --link redis-playground:redis --rm redis redis-cli -h redis -p 6379 |
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
// #loljavascript | |
var settings = { | |
cacheExpiresSec: 10, | |
extraParams: "&extraParams=your-id-here", // enter your id here | |
retry: { | |
factor: 2, | |
max: 5, | |
maxRetries: 5, | |
}, |
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 | |
set -uxe | |
# Reads the ssm path and echos out the parameters in the form | |
# export NAME=some-value | |
readonly path=$1 | |
exec aws --region us-east-1 ssm get-parameters-by-path --no-paginate --path $path --with-decryption --query Parameters | \ | |
jq -r 'map("\(.Name | sub("'$path'";""))=\(.Value)") | join("\n")' | \ |
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
# This guide outlines how to: | |
# 1. Generate a AWS KMS data key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys). | |
# 2. Encrypt a secret using the generated data key. | |
# 3. Decrypt the encrypted secret. | |
# generate a kms data key | |
aws kms generate-data-key-without-plaintext \ | |
--key-id <key-id> \ | |
--key-spec AES_256 \ |
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 org.scalacheck._ | |
import play.api.libs.json._ | |
val genJsArray: Gen[JsArray] = | |
for { | |
n <- Gen.chooseNum(0, 10) | |
arr <- Gen.containerOfN[IndexedSeq, JsValue](n, genJsValue).map(JsArray) | |
} yield arr | |
val genJsObject: Gen[JsObject] = |
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 | |
set -ue | |
readonly roleArn="$1" | |
readonly durationSeconds="3600" # 1 hours | |
readonly roleSessionName="$USER-local" | |
# Use default profile to log in | |
unset AWS_ACCESS_KEY_ID | |
unset AWS_SECRET_ACCESS_KEY |
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
#!/usr/bin/env amm | |
import ammonite.ops._, ImplicitWd._ | |
case class Version(major: Int, minor: Int, patch: Int, label: String) { | |
def tag = s"v$major.$minor.$patch$label" | |
} | |
def parseVersion(s: String) = { | |
val VersionPattern = "^v(\\d+).(\\d+).(\\d+)(-.+)?$".r | |
val VersionPattern(major, minor, patch, labelNullable) = s |
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 $ivy.{ | |
`org.typelevel::cats-effect:1.0.0-RC2`, | |
`org.typelevel::cats-core:1.1.0` | |
} | |
val scalacOptions = List("-Ypartial-unification") | |
interp.preConfigureCompiler(_.processArguments(scalacOptions, true)) | |
// reload compiler | |
@ |
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 com.gubbns | |
import cats.data.{Kleisli, OptionT} | |
import cats.effect._ | |
import cats.implicits._ | |
import com.github.blemale.scaffeine.{Cache, Scaffeine} | |
import org.http4s._ | |
import org.http4s.headers._ | |
import org.http4s.server.Middleware |
OlderNewer