Skip to content

Instantly share code, notes, and snippets.

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']
})
@SgtPooki
SgtPooki / index.js
Last active October 26, 2023 17:35
@sgtpooki/bulk-import-cid -- temporary stop-gap for https://github.com/ipfs/ipfs-desktop/issues/2680
#!/usr/bin/env node
// @ts-check
import { path } from 'kubo'
import {execa} from 'execa';
// get input filename from command line
const filename = process.argv[2];
console.log(`filename: `, filename);
const {stdout} = await execa('echo', ['unicorns']);
@SgtPooki
SgtPooki / generateIPFSLinks.sh
Created October 24, 2023 01:10
We want to output a list of IPFS links for all the domains using dig and return only the strings that match "dnslink=/ipfs/Qm..."
@SgtPooki
SgtPooki / dependents-change.js
Last active November 7, 2023 01:36
This script requires a markdown table for input, as generated by https://github.com/nvuillam/github-dependents-info. It compares the current table with the previous one and outputs a new table with the changes in stars.
#!/usr/bin/env node
/**
* This script requires a markdown table for input, as generated by https://github.com/nvuillam/github-dependents-info
* It compares the current table with the previous one and outputs a new table with the changes in stars.
* Usage:
* github-dependents-info --repo ipfs/helia --markdownfile ./package-usage-2023-09.md --sort stars --verbose -x 2 -p
* // manually copy the Repostory and Stars table to `current.md`
* // manually copy the Repostory and Stars table from the previous month to `previous.md`
* node dependents-change.js
*
@SgtPooki
SgtPooki / find-webtransport-peers.js
Created September 14, 2023 21:03
use Helia to test if certain peers are listening on webtransport
import { multiaddr } from '@multiformats/multiaddr'
import { WebTransport } from '@multiformats/multiaddr-matcher'
import { createHelia } from 'helia'
const helia = await createHelia()
const multiaddrs = [
// fill out multiaddrs for peers you want to check here:
'/ip4/123.45.67.89/tcp/4001/ipfs/Qmabcdefg...',
'/ip4/98.76.54.32/tcp/4004/ipfs/bafyka...',
@SgtPooki
SgtPooki / IssueDesc.md
Created January 25, 2023 16:25
Markdown

eta: 2023Q4

children:

  • #121
  • #122
  • #123
  • #124
@SgtPooki
SgtPooki / output.txt
Created January 6, 2023 21:19
Attempt to generate a list of packages that need updated in order to update a dependency. My ideal goal for something like this is to run a script via `npx` in a project, with something like `[email protected]` and get out a list of dependencies to update working in a depth-first order.
╰─ ✔ ❯ npx -y ts-node parse-ls-output.ts
Package update order:
interface-ipfs-core - (depended on by 1 packages)
@ipld/car - (depended on by 1 packages)
@libp2p/interface-peer-id - (depended on by 1 packages)
@libp2p/peer-id-factory - (depended on by 1 packages)
@libp2p/peer-id - (depended on by 1 packages)
blockstore-core - (depended on by 1 packages)
dag-jose - (depended on by 1 packages)
did-jwt - (depended on by 1 packages)