Skip to content

Instantly share code, notes, and snippets.

View dimitarg's full-sized avatar

Dimitar Georgiev dimitarg

View GitHub Profile
@dimitarg
dimitarg / Repro.scala
Created March 31, 2022 15:26
Translated stream behaving badly - what did I mess up?
package repro
import scala.concurrent.duration._
import cats.implicits._
import cats.~>
import cats.arrow.FunctionK
import cats.data.Kleisli
import cats.effect.IO
import fs2.Stream
@dimitarg
dimitarg / jakub.md
Created April 7, 2021 13:25
Dossier on Jakub

Dossier on Jakub

Supposedly immortal but apparently blockable

@dimitarg
dimitarg / machine_setup.txt
Last active August 31, 2020 16:29
Machine setup
Loosely documenting my machine setup in an effort to make this somewhat reproducible or automate it in the future
- Install PopOS
- Install zsh
- Install oh-my-zsh
- `sudo apt-get install openjdk-11-jdk`
- Download / install vscode
- Install scalametals vscode extension
package demo
import fj.P
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
class FjLazy<in R,T>(init: () -> T) : ReadOnlyProperty<R, T> {
val initIt = P.hardMemo(init)
private static <A> Option<Tree<A>> filterTopDown(Tree<A> tree, Predicate<A> pred)
{
if (!pred.test(tree.root()))
{
return none();
}
Stream<Tree<A>> filteredChildren = tree.subForest().f().map(child -> filterTopDown(child, pred)).filter(x -> x.isSome())
.map(x -> x.some());
return some(node(tree.root(), filteredChildren));
@dimitarg
dimitarg / selfBounded.js
Created April 4, 2017 07:36
typechecks but transform-flow-strip-types does not cope with it
/* @flow */
export interface Val {
equals<this>(other: this) : boolean
}
//@flow
declare var test: any
declare var expect: any
import {Seq} from "immutable"
test("hmmm", () => {
const xs : Seq<number, string> = Seq.of("a", "b", "c")
// this does not typecheck, map not found in Seq
package com.dimitarg.demo;
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
import java.util.function.Function;
/**
* Created by fmap on 25.11.16.
package foo
import org.junit.Test
import scalaz._
import Scalaz._
import org.junit.Assert._
import org.hamcrest.CoreMatchers.is