Skip to content

Instantly share code, notes, and snippets.

View melvincarvalho's full-sized avatar
💭
I may be slow to respond.

Melvin Carvalho melvincarvalho

💭
I may be slow to respond.
View GitHub Profile
@melvincarvalho
melvincarvalho / iofailure.txt
Created April 26, 2024 18:13
iofailure.txt
wss://sg.unfiltered.zone
websocat: WebSocketError: I/O failure
--
wss://relay.nostrfiles.dev
websocat: WebSocketError: I/O failure
--
wss://paid.nostrified.org
websocat: WebSocketError: I/O failure
--
wss://nostr.libertasprimordium.com
@melvincarvalho
melvincarvalho / NIP-133.md
Last active March 26, 2024 16:42
NIP-133.md

NIP-133

Nostr Game Score Event

draft optional author:melvincarvalho

This NIP defines an event used to represent scores for players within various games on the Nostr network. Each game is uniquely identified by a d tag, and each Nostr user can have a score associated with that game.

@melvincarvalho
melvincarvalho / nip135.md
Last active January 19, 2024 01:30
nip135.md

NIP-135

DNSTR - Domain Name Mapping for Nostr Public Keys

draft optional author:melvincarvalho

This NIP defines a way to associate a Nostr public key with a domain name.

@melvincarvalho
melvincarvalho / WebID-JSON-LD.md
Last active November 8, 2023 17:18
WebID-JSON-LD.md

WebID-JSON-LD Specification

Author: Melvin Carvalho

Abstract

The WebID-JSON-LD specification extends the WebID protocol to include JSON-LD formatted RDF responses, providing a structured, decentralized method for identity discovery via a JSON-based data format.

Table of Contents

@melvincarvalho
melvincarvalho / charter.md
Created October 1, 2023 02:06
charter.md
  • W3C Social Web Working Group Charter Brainstorming

Welcome to the brainstorming page for collecting thoughts, methodologies, and opinions for chartering a new W3C Social Web Working Group.

Please adhere to the W3C code of conduct when making contributions and edits.

  • Purpose

    This page is not a formal charter, either for a Community Group (CG) or Working Group (WG). Instead, it's a space for collecting diverse and broad input to consider for the creation of a working group charter.
  • About Working Groups

    W3C typically forms working groups to facilitate collaboration among implementers in updating and creating specifications for greater interoperability. Chairs and spec editors, while often not implementers themselves, play a crucial role in moving specifications forward.

W3C Charter for Social Web Working Group: ActivityPub 2.0 and Activity Streams 3

  1. Introduction
    • Background and motivation for the Social Web Working Group
    • The role of ActivityPub 2.0 and Activity Streams 3 in the evolution of the social web
  2. Scope and Objectives
    • Define the scope of the Social Web Working Group
    • List the objectives and goals of the working group
  3. Key Deliverables
  • ActivityPub 2.0 Specification
import json
import argparse
from typing import List, Dict, Optional
from fastapi import FastAPI, WebSocket
from pydantic import BaseModel
from nostr import tools
import ssl
import uvicorn
parser = argparse.ArgumentParser()
@melvincarvalho
melvincarvalho / phone.js
Last active May 6, 2023 22:04
phone.js
#!/usr/bin/env node
import fastify from 'fastify'
import fastifyWebsocket from '@fastify/websocket'
import { validateEvent, verifySignature } from 'nostr-tools'
const port = process.argv[2] || 3000
const events = []
const subscribers = new Map()
@melvincarvalho
melvincarvalho / nostr-tx-broadcast.js
Created April 27, 2023 08:16
nostr-tx-broadcast.js
const WebSocket = require('ws');
const bitcoin = require('bitcoinjs-lib');
const fetch = require('node-fetch');
const base64 = require('base64-js');
const relays = [
'wss://nostr.wine',
'wss://nos.lol',
'wss://nostr.fmt.wiz.biz',
'wss://nostr.zebedee.cloud',
@melvincarvalho
melvincarvalho / GPG -> WebID convertor
Created December 21, 2011 10:58
GPG -> WebID convertor
package net.java.dev.sommer.foafserver.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;