Skip to content

Instantly share code, notes, and snippets.

@dskvr
dskvr / default
Last active April 15, 2024 22:37
server {
listen 80;
listen [::]:80;
server_name {{ RELAY_URL }};
return 301 https://$host$request_uri;
}
server {
root /path/to/myrelaypage
@dskvr
dskvr / nip-fiatjaf-aneurysm.md
Last active March 28, 2024 14:56
maybe some useful bits in here for anyone who feels like entering the battle arena.

NIP-AND-FILTERS

Enable AND within a single tag filter by using an & modifier in filters for indexable tags.

filters: {
  "kinds": [1],
  "&t": ["meme", "cat"],
  "#t": ["black", "white"]
}
@dskvr
dskvr / package.json
Last active January 22, 2024 22:00
nostr gossip/outbox protocol event generator [proof of concept] ... earlier versions of this utilized NIP-66 but for the proof of concept I simplified it to ONLY account for online relays, as opposed to the full dataset of NIP-66. replace the API getter with a NIP-66 getter & map relay characteristics so you can utilize them when applying a bias.
{
"name": "gossip.events",
"type": "module",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"fast-safe-stringify": "2.1.1",
"node-cache": "5.1.2",
"nostr": "0.2.8"
@dskvr
dskvr / squash-all-retain-coauthors.sh
Last active November 28, 2023 02:20
Script to generate co-authored-by messages and then squash all commits in a branch. Retain github collaboration data
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Variables
BRANCH_TO_SQUASH="main"
NEW_BRANCH="legacy-squash"
DRY_RUN=true # Set to false to perform actual operations
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -504,6 +504,14 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
return set_error(serror, SCRIPT_ERR_MINIMALDATA);
}
stack.push_back(vchPushValue);
+ if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) && opcode == OP_FALSE) {
+ auto pc_tmp = pc;
+ opcodetype next_opcode;
+ valtype dummy_data;
@dskvr
dskvr / gist:db9d13b29a3bc9db0f3ef32e0d6f1d4d
Last active August 2, 2023 17:10
Unsigned experimental "user feed" gossip event using a "minimize connections" consolidation bias. Not complete due to being generated from an incomplete dataset. Goal of such a pattern would be to improve load speeds and client implementation simplicity. Utilizes 30303 events from nostr.watch to filter out offline relays
{
"created_at": 1690938995,
"content": "",
"kind": 34567
"tags": [
[
"d",
"6df59fbe7e2de656a864669d5003597613c5a2b1eb4d4bc7d904cd5a68cac775"
],
[
@dskvr
dskvr / tailwindcss-hack.css
Last active January 26, 2023 12:00
CSS classes for tailwindcss height/margin-top if extend/spacing is not working (default spacing)
/*TODO: Apply fix? https://github.com/tailwindlabs/tailwindcss/issues/10418*/
.mt-4 { margin-top: 1rem }
.mt-5 { margin-top: 1.25rem }
.mt-6 { margin-top: 1.5rem }
.mt-7 { margin-top: 1.75rem }
.mt-9 { margin-top: 2.25rem }
.mt-11 { margin-top: 2.75rem }
.mt-13 { margin-top: 3.25rem }
.mt-14 { margin-top: 3.5rem }
.mt-15 { margin-top: 3.75rem }
@dskvr
dskvr / event
Last active December 23, 2022 08:21
nostr-rs-relay will not parse this event, event validates and the signature validates against the event/pubkey. The event ids exist on the relay where the event is published. These are events in in the 1000-10000 kind range.
{
content: 'updating relays',
kind: 5,
created_at: 1671842669,
tags: [
[
'e',
'b7584184b0d47adb7452ac18ccc4071635757ce3c4f530205b8be42d7a6b4ffd'
],
[
@dskvr
dskvr / oas.yaml
Last active November 11, 2022 09:19
EOSIO OAS 3.0 File - Alpha 0.0.1 (bundled from json-schemas)
openapi: 3.0.0
info:
title: Chain API
version: 1.0.0
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
contact:
url: 'https://eos.io'
tags:
{
"$id": "https://example.com/person.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "The person's first name."
},