This file contains hidden or 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.byond.infinity.sda | |
import cats.data.{ Kleisli, OptionT } | |
import cats.effect.{ Resource, Sync } | |
import org.http4s.{ HttpRoutes, Response } | |
import cats.syntax.flatMap._ | |
import org.http4s.client.Client | |
object logging { | |
val log = org.log4s.getLogger |
This file contains hidden or 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 advent | |
import cats.syntax.all._ | |
object Sixteen extends Inputs: | |
type Rule = Int => Boolean | |
type Ticket = List[Int] | |
type TicketPosition = List[Int -> Int] | |
def parseRule: String => String \/ Rule = { s => |
This file contains hidden or 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
sealed trait Tree[+A] | |
case class Node[A](value: A, left: Tree[A], right: Tree[A]) extends Tree[A] | |
case object Leaf extends Tree[Nothing] | |
trait MinMax[A] { | |
val min: A | |
val max: A | |
} | |
implicit val intMM: MinMax[Int] = new MinMax[Int] { |
This file contains hidden or 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.IO | |
import fs2.Stream | |
import org.http4s.{HttpRoutes, Request, Response} | |
import org.http4s.dsl.Http4sDsl | |
import scala.concurrent.ExecutionContext | |
import scala.util.control.NoStackTrace | |
val ec = ExecutionContext.global | |
implicit val cs = IO.contextShift(ec) |
This file contains hidden or 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.nio.file.{ Files, Path, Paths } | |
import cats.effect.{ ContextShift, IO } | |
import org.http4s.{ HttpRoutes, Request } | |
import sttp.tapir.Endpoint | |
import sttp.tapir.redoc.http4s.RedocHttp4s | |
import sttp.tapir.openapi.circe.yaml._ | |
import sttp.tapir.docs.openapi._ | |
object DocUtils { |
This file contains hidden or 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.syntax._ | |
import io.circe._ | |
import io.circe.parser._ | |
import io.circe.generic.semiauto._ | |
import scalaz.NonEmptyList | |
sealed trait TType { | |
type Self | |
} |
This file contains hidden or 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
function zip(a1, a2){if (a1.length > 0 && a2.length > 0) return [[a1.shift(), a2.shift()]].concat(zip(a1, a2)); else return []; }; | |
(function(){ | |
var rows = document.querySelectorAll('form table')[4].querySelectorAll('tr'); | |
var actualRows = [].slice.call(rows, 3, rows.length - 1).filter((r, i) => (i + 1) % 3 != 0); | |
var mappedRows = actualRows | |
.map(row => [].slice.call(row.querySelectorAll('td')) | |
.map(td => td.textContent.trim().replace(/\s/, " "))); | |
var evenRows = mappedRows.filter((r, i) => i % 2 == 0); | |
var oddRows = mappedRows.filter((r, i) => i % 2 != 0); |
This file contains hidden or 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.byond.sparkperformance | |
import org.apache.spark.rdd.RDD | |
import org.apache.spark.sql.{Dataset, SaveMode, SparkSession} | |
object ReadWriteTest { | |
def main(args: Array[String]) { | |
val (file: String, factor: Int) = args match { | |
case Array(f, fc) => (f, fc.toInt) | |
case _ => "target/classes/sample.txt" |
This file contains hidden or 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 com.typesafe.config.Config; | |
import com.typesafe.config.ConfigFactory; | |
class Scratch { | |
public static void main(String[] args) { | |
Config config = ConfigFactory.load(); | |
System.out.println(config.getConfig("my")); | |
} | |
} |
This file contains hidden or 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
<p>A message after post</p> | |
<script type="text/javascript"> | |
alert('Success!'); | |
</script> |
NewerOlder