Skip to content

Instantly share code, notes, and snippets.

View fiatjaf's full-sized avatar

fiatjaf_ fiatjaf

View GitHub Profile
@fiatjaf
fiatjaf / remove-script-tag.go
Created September 24, 2023 13:10
golang snippet to remove script tags from a file with crude regex
package main
import (
"os"
"regexp"
"strings"
)
func main() {
for i := 0; i < len(os.Args); i++ {
@fiatjaf
fiatjaf / go.mod
Last active August 1, 2023 17:55
deriving an ethereum address from a nostr pubkey or checking if they match
module github.com/fiatjaf/ethereum-nostr
go 1.20
require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/nbd-wtf/go-nostr v0.19.5
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
)
@fiatjaf
fiatjaf / bundle.js
Last active April 27, 2023 14:37
sw - soma web wallet
This file has been truncated, but you can view the full file.
@fiatjaf
fiatjaf / README.md
Created March 26, 2023 22:21
overview of an Airtable "base" using Go

just some boilerplate for demonstrative purposes and learning how the API works and how to access each field, where and what are the IDs of each table and so on.

@fiatjaf
fiatjaf / strfry_direct.go
Last active March 13, 2023 23:27
getting an event payload from the strfry database directly from Go
package main
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"unsafe"
"github.com/bmatsuo/lmdb-go/lmdb"
@fiatjaf
fiatjaf / activity-nostr-bridge-bounty.md
Last active September 30, 2023 05:48
ActivityPub bridge Nostr relay bounty
@fiatjaf
fiatjaf / benchmark_test.go
Created December 13, 2022 14:50
fetching a list of data from Redis with ZRANGE + GET benchmarks using 4 different methods
package main
import (
"context"
"crypto/sha256"
"encoding/hex"
"log"
"net/url"
"strconv"
"testing"
@fiatjaf
fiatjaf / results.txt
Created August 18, 2022 12:03
Compiling a ScalaJS app with ESModule and CommonJSModule and sbt-esBuild
Results of transpiling and bundling a project that uses Laminar and handful of Scala libraries plus 4 reasonably-sized npm dependencies:
ESModule:
- fastLinkJS => 3.8MB
- fastLinkJS / esBuild => 4.1MB
- fullLinkJS => 3.6MB
- fullLinkJS / esBuild => 2.0MB
CommonJSModule:
- fastLinkJS => 3.8MB
@fiatjaf
fiatjaf / f.lua
Last active January 19, 2022 23:46
title = 'Free Tunnel Server'
description = [[
- Manages tunnel clients.
- Starts the LNbits main tunnel service.
This one is the free version, anyone can take a subdomain and keep it for free forever.
]]
models = {