Skip to content

Instantly share code, notes, and snippets.

Avatar

fiatjaf_ fiatjaf

View GitHub Profile
@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 May 4, 2023 20:14
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 = {
@fiatjaf
fiatjaf / Caddyfile
Created September 14, 2021 00:25
exposing eclair to the world
View Caddyfile
http://eclair.yourdomain.com {
@whitelisted {
path /createinvoice
}
@blacklisted {
not path /createinvoice
}
reverse_proxy @whitelisted http://localhost:8877 {
@fiatjaf
fiatjaf / drivechain-checklist.md
Created June 27, 2021 19:39
Drivechain Checklist
View drivechain-checklist.md

Drivechain Checklist

Check the boxes you understand and agree with. If you check more than 75% of the boxes you're a Drivechain maximalist. Otherwise you need treatment, join https://t.me/DCinsiders and ask for help.

  • Sidechains are chains independent of Bitcoin consensus. They don't add any burden to the Bitcoin full nodes.
  • Sidechains use bitcoins (BTC) as their base currency, not any shitcoin.
  • Sidechains can have different rules, implement different features, be developed by different teams.
  • Using a sidechain is completely optional.
  • Sidechains are expected to be blindly merge-mined with Bitcoin, which means they increase the Bitcoin security budget without adding any burden to the normal Bitcoin miners.
  • There are useful features that can be implemented in sidechains that we can't implement in Bitcoin today (and we don't want either, because it would clog the Bitcoin main chain which is already too small and want it to remain small).
@fiatjaf
fiatjaf / connect.sh
Created May 24, 2021 17:27
establish a lightning connection to some node and get an `init` message back
View connect.sh
# just copy and paste this somewhere changing the target node id, ip and address.
# you must have python3 and virtualenv, which can be installed with 'sudo apt install python3-virtualenv' on ubuntu
# it will download the pyln.proto library to a virtualenv and run the script below passed as a string
python3 -m venv venv
./venv/bin/pip install pyln.proto
./venv/bin/python -c '
import sys
from pyln.proto.wire import connect, PrivateKey, PublicKey
from binascii import unhexlify