Skip to content

Instantly share code, notes, and snippets.

View ghostbuster91's full-sized avatar

Kasper Kondzielski ghostbuster91

View GitHub Profile
fun powerSet(list: List<Int>): Set<List<Int>> {
return if (list.isEmpty()) {
setOf(emptyList())
} else {
list.flatMap {
listOf(list) + powerSet(list - it)
}.toSet()
}
}
fun main(args: Array<String>) {
val password = args[0]
val random = Random()
val (a, b) = generateRandoms(random, count = 2)
val lineEquation = { x: Int -> a * x + b }
val xList = generateRandoms(random, count = password.length)
val yList = xList.map { lineEquation(it) }
val yMinusAscii = yList.mapIndexed { index, y -> y - password[index].toInt() }
package io.github.ghostbuster.geometricalsec
import java.util.*
fun main(args: Array<String>) {
val password = args[0]
val random = Random()
val a = random.nextFloat()
val b = generateRandoms(random, count = 1).first()
0x10866919f37F65173411f9e40923108Ef68a8e84
0x64041195B91Fdcf14Af7065dD4396EE8eB2D3b8a
task regenerateSolc(type:Exec) {
inputs.dir("solidity")
outputs.dir("src/main/java/solidity")
commandLine './regenerate-solidity.sh'
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
import cats.data.NonEmptyList
import cats.effect.{ContextShift, IO, Resource, Timer}
import com.typesafe.scalalogging.LazyLogging
import io.circe.{Json, JsonObject}
import org.http4s.circe._
import org.http4s._
import org.http4s.client.Client
import cats.implicits._
import scala.concurrent.ExecutionContext
import estrapade.TestApp
import magnolia.{CaseClass, Magnolia}
import estrapade.{TestApp, test}
import contextual.data.scalac._
import scala.language.experimental.macros
trait StructureOf[T] {
def structure:Structure
def isOptional = false
}
import estrapade.{TestApp, test}
import magnolia.examples.Show
case class RPerson(age: Int, name: String, child: Option[RPerson])
case class GPerson(child: Option[RPerson])
object ShowDerivationTest extends TestApp {
implicit def showForOption[T](implicit ts: Show[String, T]): Show[String, Option[T]] =
new Show[String, Option[T]] {
override def show(value: Option[T]): String = {
case class Person(age: Int, name: String)