Skip to content

Instantly share code, notes, and snippets.

View fancellu's full-sized avatar

Dino Fancellu fancellu

View GitHub Profile
Swoorup / ActorK.scala
Last active July 17, 2023 19:54
Typed Actors using Cats Effect, FS2 and Deferred Magic
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{Actor, AskMsg}
KexinFeng /
Last active January 4, 2024 08:41
Deploying HuggingFace QA model in Java
import ai.djl.modality.nlp.DefaultVocabulary;
import ai.djl.modality.nlp.Vocabulary;
import ai.djl.modality.nlp.bert.BertToken;
import ai.djl.modality.nlp.bert.BertTokenizer;
import ai.djl.ndarray.NDArray;
import ai.djl.ndarray.NDList;
import ai.djl.ndarray.NDManager;
import ai.djl.translate.Batchifier;
import ai.djl.translate.Translator;
zhenwenc / DoobieSyntax.scala
Last active July 17, 2023 19:55
Doobie ConnectionIO helpers for use with Quill integration
import doobie._
import doobie.implicits._
import cats.implicits._
sealed abstract class UnexpectedResultSetSize(msg: String) extends Exception(msg)
final case object UnexpectedOptionalContinuation
extends UnexpectedResultSetSize(s"Expected ResultSet with zero or one row, but more rows were available.")
zeljic /
Last active May 20, 2024 18:23
Build SQLite3 .lib file on windows

How to build SQLite3 .lib file on Windows 10

  1. Download source from source

    For example: source

  2. Download binary from binary

    For example: binary

  3. Extract both archives to the same directory

eduncan911 /
Last active July 20, 2023 09:41
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone

Treat it like a normal repo. Edit, force push, etc.

pierrejoubert73 /
Last active May 20, 2024 22:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me


  1. Foo
  2. Bar
    • Baz
  • Qux
fancellu / .block
Last active August 3, 2023 01:59
Force directed graph for D3.js v4 with labelled edges and arrows
license: gpl-3.0
height: 600
lihaoyi / trace.scala
Last active December 27, 2015 19:32
Downloading JSON and splatting it into some files in 4 lines of Scala with Ammonite
haoyi-mbp:Ammonite haoyi$ ~/amm
Welcome to the Ammonite Repl 0.5.2
(Scala 2.11.7 Java 1.8.0_25)
haoyi-Ammonite@ load.ivy("org.scalaj" %% "scalaj-http" % "2.2.0")
haoyi-Ammonite@ import ammonite.ops._, scalaj.http._
import ammonite.ops._, scalaj.http._
haoyi-Ammonite@ Http("").asString
res2: HttpResponse[String] = HttpResponse($$anon$1(mutingStuff = let's see, otherStuff = List(works, too), stuff = works, moreLazyStuff =$$anon$1$$anon$2(extensionData = This is just some extension data))
Disconnected from the target VM, address: '', transport: 'socket'
"mutingStuff" : "let's see",
"otherStuff" : [ "works, too" ],
"stuff" : "works",
"moreLazyStuff" : {
"extensionData" : "This is just some extension data"
CliffordAnderson / collect.cypher
Last active July 10, 2018 15:59
A Cypher examples to unwind and collect
match (a {name:"Daniel"}), (b {name:"Jerry"})
with a,b
match s = shortestPath(a-[]-b)
unwind nodes(s) as n
with collect(n) as m
return head(m)