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
const assert = require('assert'); | |
describe('should-work', () => { | |
it('passes', () => { | |
const enhanceURL = (url) => | |
url.replace(/https/g, 'http').replace(/^http:\/\/([a-zA-Z0-9]+)\./gm, | |
(m, p1) => m.replace(p1, 'admin--' + p1)) | |
.replace(/\/(?=[^\/]*$)/, '/api/') | |
+ '?_content_format=json' |
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
[[syntax trees at end of parser]] // HelloWorld2.scala | |
package <empty> { | |
object HelloWorld2 extends scala.AnyRef { | |
def <init>() = { | |
super.<init>(); | |
() | |
}; | |
def main(args: Array[String]): Unit = { | |
val add2: _root_.scala.Function1[Int, Int] = ((x$1) => x$1.$plus(2)); | |
println(StringContext("Hello world! This is Scala. ", "").s(add2(40))) |
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
object HelloWorld extends App { | |
val add2: Int => Int = _ + 2 | |
println(s"Hello world! This is Scala. ${add2(40)}") | |
} |
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 cats.effect._ | |
import cats.implicits._ | |
import java.io.PrintWriter | |
import java.nio.file.Path | |
object Editor { | |
type Editor = String | |
sealed trait EditorError |
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
// Oto Brglez - <otobrglez@gmail.com> - May 2021 | |
package com.pinkstack.gen4 | |
import cats.effect.implicits._ | |
import cats.effect.{ExitCode, IO, IOApp} | |
import cats.implicits._ | |
import com.pinkstack.gen1.CoinMarketCap.Implicits._ | |
import com.pinkstack.gen1.CoinMarketCap._ | |
import sttp.client3._ | |
import sttp.client3.circe._ |
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
// Author: Oto Brglez | |
// - https://www.twitch.tv/otobrglez | |
// - https://twitter.com/otobrglez | |
import org.apache.commons.math3.distribution.EnumeratedDistribution | |
import org.apache.commons.math3.util.Pair | |
import scala.jdk.CollectionConverters._ | |
import scala.util.Random | |
object Generator { |
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
/* | |
* HttpClient that uses Scala Cats, Circe and some caching for Akka and Akka Http. | |
* Author: Oto Brglez | |
*/ | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model._ | |
import akka.http.scaladsl.model.headers.RawHeader | |
import akka.http.scaladsl.unmarshalling.Unmarshal | |
import better.files.Dsl._ |
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
# Oto Brglez - <otobrglez@gmail.com> | |
echo 'public class Main {public static void main(String[] args){ System.out.println(System.getProperty("java.home"));}}' > /tmp/Main.java && \ | |
javac /tmp/Main.java && cd /tmp && java Main && rm Main.java && cd - |
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 bash | |
set -e | |
# Author: Oto Brglez, <otobrglez@gmail.com> | |
# "MY_PROJECT_HOME" - is environment variable, usually set with | |
# something like direnv (via .env) or let to developer | |
if [[ -z "${MY_PROJECT_HOME}" ]]; then | |
echo "MY_PROJECT_HOME environment variable is not set!" && exit 255 | |
fi |
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 bash | |
# Author: Oto Brglez | |
# Mail: otobrglez@gmail.com | |
# Version: 0.0.2 | |
# LICENCE: MIT | |
# Install: | |
# - https://pandoc.org/ | |
# - https://github.com/Wandmalfarbe/pandoc-latex-template | |
# - https://www.overleaf.com/learn/latex/XeLaTeX | |
# - https://github.com/be5invis/Iosevka |