Skip to content

Instantly share code, notes, and snippets.

@SgtPooki
SgtPooki / shell-helpers.sh
Created July 28, 2025 18:29
golang helpers
# When consuming changes that are currently in PR for a dependency, run the following:
PKG=ipfs/go-log/v2
COMMIT=174cfdbd11a553230949ce958e66a90f07772ab6
go get github.com/$PKG@$COMMIT && go mod tidy
# IF there are multiple go.mod files to update, like in ipfs/kubo for instance, use the following
PKG=ipfs/go-log/v2
COMMIT=174cfdbd11a553230949ce958e66a90f07772ab6
go get github.com/$PKG@$COMMIT && find . -name go.mod -execdir go mod tidy \;
@SgtPooki
SgtPooki / README.md
Last active July 29, 2025 16:41
get slack thread discussion for posting to github issues as quoted by each user.
  1. Open a comment thread and scroll to the top
  2. copy this whole script and paste into the console
  3. scroll slowly to the bottom of the comment thread
  4. run getSlackTranscript() in the console
@SgtPooki
SgtPooki / channels_support.ts
Created May 14, 2025 17:31
simple script to test support for BroadcastChanel and MessageChannel across node/bun/deno
/**
* Simple feature‑detection helpers
* (exported so test code can get 100 % coverage).
*/
export const hasBroadcastChannel = (): boolean =>
typeof globalThis.BroadcastChannel === "function";
export const hasMessageChannel = (): boolean =>
typeof globalThis.MessageChannel === "function";
@SgtPooki
SgtPooki / README.md
Created April 16, 2025 17:18
helia verified fetch confirmation

please note the ordering of "helia:verified-fetch:trace Invoking plugin:"

@SgtPooki
SgtPooki / create-dir-example.ts
Created May 22, 2024 00:58
example of creating a directory structure with file using Helia and @helia/unixfs
const fs = unixfs(helia)
let barDir = await fs.addDirectory({ path: './bar' })
const aFileHtml = await fs.addFile({ path: './bar/a-file.html', content: uint8ArrayFromString('<html><body>Hello world</body></html>') })
barDir = await fs.cp(aFileHtml, barDir, 'a-file.html')
let fooDir = await fs.addDirectory({ path: './foo' })
fooDir = await fs.cp(barDir, fooDir, 'bar')
let deepDirCid = await fs.addDirectory({})
deepDirCid = await fs.cp(fooDir, deepDirCid, 'foo')
@SgtPooki
SgtPooki / README.md
Last active March 17, 2024 06:09
webm streaming req/res of different browsers

While debugging streaming video with the helia-service-worker-gateway, I decided to set up a basic nodejs streaming server that we could ensure a basic test case is working in the browsers, so we knew what to target.

The basic server seems to work in all browsers except for safari.

The steps to generage the attached log files are as follows:

  1. run node demo-video-server.js > <browser>.log
  2. open browser, start a new tab
openapi: 3.0.3
info:
title: IPFS Gateway API
description: |
This is an OpenAPI 3.0 specification for the IPFS Gateway API, following the specs.ipfs.tech/http-gateways/path-gateway specification.
You can find more information about IPFS at [https://ipfs.tech](https://ipfs.tech).
version: 1.0.0
servers:
- url: https://ipfs.io
paths:
@SgtPooki
SgtPooki / aider-chat.nix
Last active April 26, 2024 16:35
shell.nix files for various dev environments
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.virtualenv
(pkgs.python3.withPackages (ps: with ps; [
ps.pip
]))
];
@SgtPooki
SgtPooki / claim.fluence.network airdrop.md
Last active March 11, 2024 07:05
claim.fluence.network airdrop eligible github usernames
@SgtPooki
SgtPooki / test.js
Created February 7, 2024 20:03
@helia/verified-fetch test script
import { trustlessGateway } from '@helia/block-brokers'
import { createHeliaHTTP } from '@helia/http'
import { delegatedHTTPRouting } from '@helia/routers'
import { createVerifiedFetch } from '@helia/verified-fetch'
const helia = await createHeliaHTTP({
blockBrokers: [
trustlessGateway({
gateways: ['https://cloudflare-ipfs.com', 'https://ipfs.io', 'https://trustless-gateway.link']
})