Skip to content

Instantly share code, notes, and snippets.

View larskuhtz's full-sized avatar

Lars Kuhtz larskuhtz

View GitHub Profile
@larskuhtz
larskuhtz / Events.hs
Last active January 7, 2020 06:04
Reproduce EventSource + HTTP/2 + TLS issue
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
-- |
-- To reproduce with curl, run mainTls (from ghci) and use
--
-- @
@larskuhtz
larskuhtz / README.md
Last active May 9, 2024 19:27
Chainweb Tx History

Chainweb Transfers

Query Chainweb transfer events within a block range for a given chain.

Usage example:

CHAIN=1 MINHEIGHT=1420000 MAXHEIGHT=14201000 bash ./tranfers.sh
@larskuhtz
larskuhtz / Bench.hs
Last active November 21, 2021 22:24
JSON serialization benchmarks for Chainweb
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@larskuhtz
larskuhtz / .jq
Last active August 18, 2022 09:55
jq config file for working with Kadena chainweb payloads
# ############################################################################ #
# Base64 URL without padding
def base64dUrl: .
| gsub("(?<x>[-_])"; if .x == "-" then "+" else "/" end)
| "\(.)==="
| @base64d
;
def fromjson64: .
@larskuhtz
larskuhtz / Main.hs
Last active February 17, 2023 17:56
Bug with the mod package And GHC 9.4.4 on Linux
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main (main) where
import Data.Mod (Mod)
import GHC.TypeNats (KnownNat)
import Numeric.Natural (Natural)