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
-- vim: tabstop=2 shiftwidth=2 expandtab | |
-- We almost always start by importing the wezterm module | |
local wezterm = require 'wezterm' | |
-- Define a lua table to hold _our_ module's functions | |
local module = {} | |
-- Returns a bool based on whether the host operating system's | |
-- appearance is light or dark. | |
function module.is_dark() |
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 webm | |
import scala.collection.{GenMap, GenTraversableOnce} | |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox | |
import scala.scalajs.js | |
import scala.scalajs.js.| | |
object FunctionMacro { |
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
// summary : Just ONE ammonite script file to execute a load performance test using gatling ! | |
// keywords : scala, gatling, ammonite, scala, load-test, performance | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : ea7a4259-9461-44a8-99fa-1ec6ec3c48ed | |
// created-on : 2018-09-22T07:41:07Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// execution : scala ammonite script (http://ammonite.io/) - run as follow 'amm scriptname.sc' |
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
implicit class InfixMappable[A, B, C](f: A => B) { | |
def `<$>`[G[_]: Functor](ga: G[A]): G[B] = Functor[G].map(ga)(f) | |
} | |
val ap1: Option[Int] = ??? | |
val ap2: Option[Int] = ??? | |
val ap3: Option[Int] = ??? | |
val f: Int => Int => Int => Int = ??? | |
f `<$>` ap1 ap ap2 ap ap3 |
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
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904 | |
function jwt-decode() { | |
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq | |
} | |
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ | |
jwt-decode $JWT |