Skip to content

Instantly share code, notes, and snippets.

View ingarabr's full-sized avatar

Ingar Abrahamsen ingarabr

View GitHub Profile
@ingarabr
ingarabr / Basic.scala
Last active April 12, 2024 12:51
Experimenting with Postgres composite type. Here's two examples: Basic that extracts the columns and an attempt to read the values using doobie meta.
//> using scala 3.4
//> using dep org.tpolecat::doobie-postgres:1.0.0-RC4
package basic
import doobie.*
import doobie.implicits.*
import cats.effect.IO
import cats.*
import cats.syntax.all.*
@ingarabr
ingarabr / ScalafixImplicitArgs.scala
Last active August 10, 2019 10:00
Unable to find implicit argument in with scalafix/scalameta
package fix
object ScalafixImplicitArgs {
trait Value[A] { def value: A }
implicit val intValue: Value[Int] = new Value[Int] { def value: Int = 1 }
class Foo[A]() {
def parentheses[AA >: A]()(implicit s: Value[AA]): AA = s.value
def noParentheses[AA >: A](implicit s: Value[AA]): AA = s.value
}
import cats.effect.{Clock, Concurrent, Timer}
import cats.effect.concurrent.{Deferred, Ref}
import cats.syntax.flatMap._
import cats.syntax.functor._
import scala.concurrent.duration.{FiniteDuration, MILLISECONDS, TimeUnit}
class TickTimer[F[_]: Concurrent](tickMs: Ref[F, Long], sleeps: Ref[F, List[(Deferred[F, Unit], Long)]])
extends Timer[F] {
class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
:tag => "v2.11.0",
:revision => "2e55dbe1fdb5fdb96b75ff144a339489417b146b"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
@ingarabr
ingarabr / keybase.md
Created September 17, 2017 21:20
keybase

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

package com.abrahams1.guava;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import java.util.List;
import org.junit.Test;
import static com.abrahams1.guava.GuavaIterable.IntegerPredicate.*;
import static com.google.common.collect.Lists.newArrayList;
import static org.hamcrest.core.AllOf.allOf;
import static org.hamcrest.core.IsNot.not;