Skip to content

Instantly share code, notes, and snippets.

View fiadliel's full-sized avatar

Gary Coady fiadliel

View GitHub Profile

Dear Mr. Brown:

We represent the legal interests of our client, Mr. John Arlen De Goes, Maryland, USA.

For several years now, you have repeatedly defamed our client on the internet. Your public blog https://meta.plasm.us/posts/2019/09/01/jdg-and-the-fp-community/ specifically targets our client with the goal to publicly vilify our client. This blog can be easily found with the help of search engines like Google by just searching for the name of our client. On this blog, amongst other false statements, you falsely allege the following about our client:

(1) False statement:

“De Goes defending white supremacists and misogynists.”

Keybase proof

I hereby claim:

  • I am fiadliel on github.
  • I am fiadliel (https://keybase.io/fiadliel) on keybase.
  • I have a public key ASDwpqfKxqIvnJDZ4u70iEAJKA9pdM2NQVZPBVJGOU0_Rgo

To claim this, I am signing this object:

import fs2._
case class ProcessState(exitValue: Task[Int],
output: Stream[Task, Byte],
input: Sink[Task, Byte],
error: Stream[Task, Byte])
object RunProgram {
val waitThreadStrategy = Strategy.fromCachedDaemonPool("wait-threads")
@fiadliel
fiadliel / Output
Created October 16, 2016 10:47
Example for sbt-api-mappings bug
$ sbt doc
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1G; support was removed in 8.0
[info] Loading global plugins from /home/xxx/.sbt/0.13/plugins
[info] Loading project definition from /home/xxx/sbt_api_mappings/project
[info] Set current project to sbt_api_mappings (in build file:/home/xxx/sbt_api_mappings/)
scala.MatchError: scala-compiler-2.12.0-RC1.jar (of class java.lang.String)
at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:41)
at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:39)
at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:722)
at scala.collection.immutable.List.foreach(List.scala:318)
import fs2._
def pipeR[F, A, B, C](pipe: Pipe[F, B, C]): Pipe[F, (A, B), (A, C)] = {
s =>
s.map(_._1).zip(s.map(_._2).through(pipe))
}
def pipeL[F, A, B, C](pipe: Pipe[F, A, C]): Pipe[F, (A, B), (C, B) = {
s =>
s.map(_._1).through(pipe).zip(s.map(_._2))
import doobie.imports._
import doobie.util.compat.cats.monad._ // todo: make this automatic
import cats._, cats.data._, cats.implicits._
import doobie.util.capture.{Capture => DCapture}
import doobie.util.catchable.{Catchable => DCatchable}
object Implicits {
implicit def doobieCatchable[F[_]](implicit F: ApplicativeError[F, Throwable]): DCatchable[F] = new DCatchable[F] {
def attempt[A](ma: F[A]): F[cats.data.Xor[Throwable, A]] = F.attempt(ma)
import doobie.util.catchable.{Catchable => DCatchable}
import doobie.util.capture.{Capture => DCapture}
import fs2.Task
import fs2.util.Effect
object Implicits {
implicit def doobieCatchable[F[_]](implicit F: Effect[F]): DCatchable[F] = new DCatchable[F] {
def attempt[A](ma: F[A]): F[cats.data.Xor[Throwable, A]] =
F.attempt(ma).map(_.fold(Xor.left, Xor.right))
@fiadliel
fiadliel / ZipReader.scala
Created August 30, 2015 23:23
Reading Zip files with scalaz-stream
import java.io.{File, FileNotFoundException, IOException, InputStream}
import java.util.zip.{ZipEntry, ZipException, ZipFile}
import org.http4s.DateTime
import scodec.bits.ByteVector
import scalaz._
import scalaz.Scalaz._
import scalaz.concurrent.Task
@fiadliel
fiadliel / ServerSentEvents.scala
Last active August 29, 2015 14:28
Retrying on error...
import com.ning.http.client._
import com.typesafe.scalalogging.StrictLogging
import scodec.bits.ByteVector
import scala.concurrent.duration._
import scalaz._
import scalaz.Scalaz._
import scalaz.concurrent.Task
import scalaz.stream._
scala> import Implicits._
import Implicits._
scala> FirstEvent("hello")
res0: FirstEvent = FirstEvent(hello)
scala> res0.handle
res1: String = hello
scala> ThirdEvent("hello")