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
View remove-script-tag.go
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
View go.mod
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
View bundle.js
This file has been truncated, but you can view the full file.
"use strict";(()=>{var MC=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(n,r)=>(typeof require<"u"?require:n)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Gf=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var KK=Gf(kC=>{"use strict";Object.defineProperty(kC,"__esModule",{value:!0});kC.crypto=void 0;kC.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var zC=Gf((Kt,j8)=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.randomBytes=Kt.wrapConstructorWithOpts=Kt.wrapConstructor=Kt.checkOpts=Kt.Hash=Kt.assertHash=Kt.assertBytes=Kt.assertBool=Kt.assertNumber=Kt.concatBytes=Kt.toBytes=Kt.utf8ToBytes=Kt.asyncLoop=Kt.nextTick=Kt.hexToBytes=Kt.bytesToHex=Kt.isLE=Kt.rotr=Kt.createView=Kt.u32=Kt.u8=void 0;var BC=KK(),ant=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);Kt.u8=ant;var pnt=t=>new Uint32Array(t.buffer,t.byteOffset,Math.flo
@fiatjaf
fiatjaf / README.md
Created March 26, 2023 22:21
overview of an Airtable "base" using Go
View README.md

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
View strfry_direct.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
View activity-nostr-bridge-bounty.md
@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
View benchmark_test.go
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
View results.txt
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
View f.lua
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 = {