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
{ | |
"@context": [ | |
"https://www.w3.org/2018/credentials/v1", | |
"https://www.w3.org/2018/credentials/examples/v1" | |
], | |
"id": "http://example.edu/credentials/1872", | |
"type": ["VerifiableCredential", "AlumniCredential"], | |
"issuer": "https://example.edu/issuers/565049", | |
"issuanceDate": "2010-01-01T19:23:24Z", | |
"credentialSubject": { |
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
{ | |
"@context": [ | |
"https://www.w3.org/2018/credentials/v1", | |
"https://www.w3.org/2018/credentials/examples/v1" | |
], | |
"id": "http://example.edu/credentials/1872", | |
"type": ["VerifiableCredential", "AlumniCredential"], | |
"issuer": "https://example.edu/issuers/565049", | |
"issuanceDate": "2010-01-01T19:23:24Z", | |
"credentialSubject": { |
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.syntax.all.* | |
import cats.syntax.all.* | |
import cats.effect.* | |
import fs2.Stream | |
import cats.effect.std.Queue | |
import scala.concurrent.duration.* | |
import lib.FSM | |
import lib.actor.{Actor, AskMsg} |
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
{-# OPTIONS --without-K --safe #-} | |
Type = Set | |
record Σ {A : Type } (B : A → Type) : Type where | |
constructor | |
_,_ | |
field | |
pr₁ : A | |
pr₂ : B pr₁ |
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 java.io.{File, FileOutputStream, IOException} | |
import java.nio.file.* | |
import java.nio.file.attribute.* | |
import scala.collection.immutable.Map | |
trait Cache(var db: Map[Path, BasicFileAttributes]): | |
lazy val mod: Map[Path, FileTime] = db.view.mapValues(_.lastModifiedTime).toMap | |
val start = java.nio.file.Path.of(".") |
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 monocle | |
import monocle.Lens | |
import monocle.syntax.all.* | |
import java.time.{Clock, Instant} | |
import scala.collection.immutable.* | |
//for an intro to Monocle see the video https://twitter.com/bblfish/status/1413758476896153601 | |
// and the thread of references above it. |
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 java.nio.charset.StandardCharsets | |
import java.security.spec.{PKCS8EncodedKeySpec, X509EncodedKeySpec} | |
import java.security.KeyFactory | |
import java.util.Base64 | |
val singleSlsh = raw"\\\n *".r | |
//java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider) | |
def rfc8792single(str: String) = singleSlsh.replaceAllIn(str.stripMargin,"") | |
def base64Decode(str: String) = Base64.getDecoder.decode(str) |
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 calculates the Sigma, Delta, Pi adjunctions for a functor F from | |
// the schema for 2 arrow quivers to 3 arrow quivers on a simple instance | |
// see https://www.categoricaldata.net/ . | |
// ie it shows two translations of a directed graph to a RDF like directed | |
// graph. Sigma just gives each arrow a type, Pi duplicates the graph as | |
// many times as their are nodes and for all the arrows in one of the duplicated | |
// graphs assigns it one of the nodes. | |
typeside Ty = literal { | |
java_types |
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 org.w3.banana | |
import scala.util._ | |
trait Prefix[T <: RDFObj](using val rdf: T) { | |
def prefixName: String | |
def prefixIri: String | |
def apply(value: String): rdf.URI | |
def unapply(iri: rdf.URI): Option[String] |
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 org.w3.banana | |
import org.w3.banana._ | |
trait RDFOps[Rdf <: RDF & Singleton](using val Rdf: RDF) { | |
def emptyGraph: Rdf.Graph | |
} | |
trait PointedGraph[Rdf <: RDF & Singleton](using val ops: RDFOps[Rdf]) { |
NewerOlder