Skip to content

Instantly share code, notes, and snippets.

@guymers
guymers / npm
Created July 27, 2023 23:34
bwrap
#!/bin/sh
# export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/config"
# $ cat ~/.config/npm/config
# prefix=${XDG_DATA_HOME}/npm
# cache=${XDG_CACHE_HOME}/npm
# init-module=${XDG_CONFIG_HOME}/npm/init.js
# fund=false
# update-notifier=false
@guymers
guymers / PKGBUILD
Last active April 18, 2024 11:12
AUR graalvm-jdk-ce-bin
_javaver=22
pkgver="${_javaver}.0.1"
_graalver="${pkgver}+8.1"
pkgrel=1
pkgname="graalvm-jdk-ce-bin"
pkgdesc="GraalVM is a high-performance JDK designed to accelerate Java application performance while consuming fewer resources."
arch=('aarch64' 'x86_64')
url='https://www.graalvm.org/'
license=('custom')
depends=(
@guymers
guymers / PKGBUILD
Last active April 18, 2024 11:09
AUR google-cloud-cli
pkgname="google-cloud-cli"
pkgver=472.0.0
pkgrel=1
pkgdesc="Create and manage Google Cloud resources and services directly on the command line or via scripts using the Google Cloud CLI."
url="https://cloud.google.com/cli"
license=("Apache")
arch=('x86_64')
depends=('python')
optdepends=(
"python-crcmod: [gsutil] verify the integrity of GCS object contents"
@guymers
guymers / tuple_repeat.scala
Created June 24, 2022 01:09
Scala 3 tuple repeat
import scala.compiletime.*
import scala.compiletime.ops.int.*
type RepeatN[N <: Int, A] <: Tuple = N match {
case 0 => EmptyTuple
case S[n] => A *: RepeatN[n, A]
}
def repeat[N <: Int, A](n: N)(a: A): RepeatN[n.type, A] = {
val tuple = n match {
@guymers
guymers / zstream.scala
Created June 20, 2022 11:15
ZStream.distributedWith on a sum type
type DistributedSumType[E, Tup <: Tuple] <: Tuple = Tup match {
case EmptyTuple => EmptyTuple
case h *: t => Dequeue[Exit[Option[E], h]] *: DistributedSumType[E, t]
}
extension [R, E, O](v: ZStream[R, E, O]) {
inline def distributedSumType[E1 >: E](maximumLag: Int)(using
m: Mirror.SumOf[O],
): ZManaged[R, Nothing, DistributedSumType[E1, m.MirroredElemTypes]] = {

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: