Skip to content

Instantly share code, notes, and snippets.

View yeus's full-sized avatar

Thomas Meschede yeus

View GitHub Profile
@yeus
yeus / PeerIdManager.ts
Created September 2, 2025 18:52 — forked from Realman78/PeerIdManager.ts
Libp2p with static peer IDs
import { readFile, writeFile } from 'fs/promises'
import { existsSync } from 'fs'
import { generateKeyPair, privateKeyToProtobuf, privateKeyFromProtobuf } from '@libp2p/crypto/keys'
import { peerIdFromPrivateKey } from '@libp2p/peer-id'
import type { PrivateKey } from '@libp2p/interface'
import type { PeerId } from '@libp2p/interface'
/**
* Utility class for managing persistent libp2p peer IDs
*
@yeus
yeus / bigdata-file-viewer.nix
Created January 4, 2025 21:45
nix package definition for bigdata-file-viewer
{ pkgs ? import <nixpkgs> { }, ... }:
# we used this reference here to create the package:
# https://ryantm.github.io/nixpkgs/languages-frameworks/maven/#maven-buildmavenpackage
let jdk = pkgs.jdk21.override { enableJavaFX = true; };
in pkgs.maven.buildMavenPackage rec {
pname = "bigdata-file-viewer";
version = "1.1.1";
src = pkgs.fetchFromGitHub {
@yeus
yeus / helia_test.html
Last active November 20, 2024 20:08
Helia minimal html test
<!doctype html>
<html lang="en">
<head>
<title>Helia Node Status</title>
<script src="https://cdn.jsdelivr.net/npm/helia@5.1.0/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@helia/unixfs@4.0.0/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@helia/strings@4.0.0/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/libp2p@2.2.1/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@chainsafe/libp2p-yamux@7.0.1/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@chainsafe/libp2p-noise@16.0.0/dist/index.min.js"></script>
# flake.nix
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
/*poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};*/
};
@yeus
yeus / automated_blog_writing.md
Last active May 30, 2023 00:26
automated_blog_writing.md

May 29, 2023

An example of using pydoxtools for LLM based article writing and file/directory-based information retrieval

When Python Libraries Talk: Pydoxtools Writes Blog Post About Itself in Fewer Than 100 Lines of Code!

We wrote the first blogpost about Pydoxtools completely automatically - using Pydoxtools! Here is the code how this was done.

:::info This was the prompt used to generate the first blogpost:

@yeus
yeus / sql_nlp_ingesting.py
Created May 10, 2023 16:01
doing NLP calculations on SQL db
"""
In this example we will extract information from
an SQL database and inject it into chroma db.
"""
import logging
from pathlib import Path
import chromadb
import dask
@yeus
yeus / test.py
Last active May 20, 2023 20:17
playing with pydoxtools
"""
In this example we will extract information from
an SQL database and inject it into chroma db.
"""
import logging
import uuid
from pathlib import Path
import chromadb
"""
In this example we will extract information from
an SQL database and inject it into chroma db.
"""
import logging
from pathlib import Path
import chromadb
import dask
@yeus
yeus / spacy_trf_vecs.py
Created April 5, 2022 21:06
spacy > 3.0 transformers contextual vectors pipeline component
from spacy.language import Language
from spacy.tokens import Doc
@Language.factory('trf_vectors')
class TrfContextualVectors:
"""
Spacy pipeline which add transformer vectors to each token based on user hooks.
https://spacy.io/usage/processing-pipelines#custom-components-user-hooks
https://github.com/explosion/spaCy/discussions/6511