Skip to content

Instantly share code, notes, and snippets.

FROM bash
COPY test*.sh ./
RUN bash test_scenario.sh
@teghnet
teghnet / main.go
Last active November 12, 2020 07:06
package main
import (
"log"
"sync"
"time"
)
type SemaphoredWaitGroup struct {
sem chan bool
@teghnet
teghnet / main.go
Last active December 12, 2021 23:20
Homemade CLI Tools
// This is an example for:
// https://www.tegh.net/2021/12/12/homemade-cli-tools/
package main
import (
"errors"
"fmt"
"io"
"log"
"os"
func must[t any](c t, err error) t {
if err != nil {
log.Fatalln(err)
}
return c
}
@teghnet
teghnet / state.go
Created October 30, 2023 11:33
State Machine for Charm
// Package state is for implementing a simple state machine.
// In a [tea.Model.Update] method one can use a `case` for a [Transition] message to change the state.
//
// case state.Transition:
// if !msg.Used() {
// m.State = msg.State()
// return m, msg.AsUsed()
// }
package state
@teghnet
teghnet / sign-with-frame-sh.go
Last active March 25, 2024 16:29
This is how you can sign a message with an embedded RPC server in frame.sh using https://github.com/defiweb/go-eth
package main
import (
"context"
"fmt"
"github.com/defiweb/go-eth/rpc"
"github.com/defiweb/go-eth/rpc/transport"
"github.com/defiweb/go-eth/types"
"github.com/defiweb/go-eth/wallet"
@teghnet
teghnet / main.go
Created August 19, 2024 12:07
Encryption and Decryption
package main
import (
"crypto/ecdsa"
"crypto/rand"
"fmt"
"log"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@teghnet
teghnet / cabure-attestation-ppv2-ceremony-deposit-318.json
Created July 11, 2026 16:10
Caburé attestation — ppv2-ceremony / deposit #318
{
"ceremony": "ppv2-ceremony",
"circuit": "deposit",
"index": 318,
"h_k": "0xad9e49fe0c2de1b04f5a2820ad7c49fff3ee14fa96f1c0eadf0575a10694e23301fe925d6f8d2f05e4a5adedf6a6346c6dca26f12b65dd230fb0de2cca9f786a"
}
@teghnet
teghnet / cabure-attestation-ppv2-ceremony-ragequit-314.json
Created July 11, 2026 16:10
Caburé attestation — ppv2-ceremony / ragequit #314
{
"ceremony": "ppv2-ceremony",
"circuit": "ragequit",
"index": 314,
"h_k": "0xbf7818cd6697c4ea7a1fae519db08155084a177bde73165df540e4a993a049071a57285b542db668cd7c358b8b1853c10f9e930efe083205c402718aafb9faca"
}