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.scalawilliam.example.play | |
import play.api.libs.ws._ | |
/** | |
* Play's Scala WS library is very very cool. Provides you with plenty niceties. | |
* See more: https://www.playframework.com/documentation/2.3.x/ScalaWS | |
* | |
* Unfortunately it by default requires a Play application context. | |
* But you do not necessarily always want that. |
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
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) |
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
myfine.domain.user.actor.handlers.BetterAnonymousClassApp$$anon$1(mutingStuff = let's see, otherStuff = List(works, too), stuff = works, moreLazyStuff = myfine.domain.user.actor.handlers.BetterAnonymousClassApp$$anon$1$$anon$2(extensionData = This is just some extension data)) | |
Disconnected from the target VM, address: '127.0.0.1:55780', transport: 'socket' | |
{ | |
"mutingStuff" : "let's see", | |
"otherStuff" : [ "works, too" ], | |
"stuff" : "works", | |
"moreLazyStuff" : { | |
"extensionData" : "This is just some extension data" | |
} | |
} |
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
haoyi-mbp:Ammonite haoyi$ ~/amm | |
Loading... | |
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("https://api.github.com/repos/scala/scala").asString | |
res2: HttpResponse[String] = HttpResponse( |
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
license: gpl-3.0 | |
height: 600 |
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 [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git
Treat it like a normal repo. Edit, force push, etc.
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 doobie._ | |
import doobie.implicits._ | |
import cats.data.NonEmptyList | |
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.") |
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 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.modality.nlp.qa.QAInput; | |
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; |