Skip to content

Instantly share code, notes, and snippets.

View lbialy's full-sized avatar

Łukasz Biały lbialy

View GitHub Profile
@lbialy
lbialy / Helpers.scala
Last active February 27, 2024 17:19 — forked from prolativ/Helpers.scala
import scala.quoted.*
extension (using quotes: Quotes)(repr: quotes.reflect.TypeRepr)
def flatMapResultType(f: quotes.reflect.TypeRepr => Option[quotes.reflect.TypeRepr]): Option[quotes.reflect.TypeRepr] =
import quotes.reflect.*
repr match
case MethodType(paramNames, paramTypes, resultType) =>
resultType.flatMapResultType(f).map(tp => MethodType(paramNames)(_ => paramTypes, _ => tp))
// case PolyType => // should not appear here
case tp =>
@lbialy
lbialy / release-repository.sh
Created September 24, 2023 08:05 — forked from romainbsl/release-repository.sh
Sonatype: close and release a staging repository
#!/usr/bin/env bash
username=
password=
stagedRepositoryId=
while [ "$1" != "" ]; do
case $1 in
-u | --username)
shift