Skip to content

Instantly share code, notes, and snippets.

@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
@dskvr
dskvr / package.json
Last active August 15, 2024 08:34
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 / 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 / myrelay.page-nginx-strfry
Last active April 19, 2024 18:29
nginx configuration tips for myrelay.page and strfry
#important!
map $http_accept $upstream {
default 127.0.0.1:8080;
application/nostr+json 127.0.0.1:7777;
}
server {
...other stuff
location / {
@dskvr
dskvr / bambu_lab-lovelace.yaml
Created June 7, 2024 13:53
Bambu Lab P1S Lovelace Dashboard
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-title-card
title: Bambu Lab X1C
alignment: start
- type: custom:mod-card
card:
type: custom:mushroom-chips-card
{
"content": "{\"contact\":\"[email protected]\",\"description\":\"Damus strfry relay\",\"name\":\"damus.io \",\"pubkey\":\"32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245\",\"software\":\"git+https://github.com/hoytech/strfry.git\",\"supported_nips\":[1,2,4,9,11,20,22,28,40,70],\"version\":\"0.9.2-88-g1d206d1ce9f2\"}",
"created_at": 1723894146,
"id": "3c2a8bf4f2625ad52b0f7f318a42d6c497f110ddcc3223b376513e1c4714c2fa",
"kind": 30166,
"pubkey": "9bbbb845e5b6c831c29789900769843ab43bb5047abe697870cb50b6fc9bf923",
"sig": "e35b240ed8c3438be0ded977eb528fb4b0490a27b63da38e478034ec0d34e7d72ae8725691de2778b2c2f486bbbb2a992ca0694237a4d43bbc411c15f336113d",
"tags": [
[
"d",
@dskvr
dskvr / nip11.serializer.ts
Last active August 30, 2024 15:21
generated with the nip11 json-schema
// To parse this data:
//
// import { Convert, Nip11 } from "./file";
//
// const nip11 = Convert.toNip11(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface Nip11 {
@dskvr
dskvr / nip11.types.ts
Created August 30, 2024 15:21
types generated with NIP-11
export interface Types {
contact: string;
description: string;
fees?: Fees;
icon?: any;
language_tags?: string[];
limitation?: Limitation;
name: string;
payments_url?: any;
posting_policy?: any;
@dskvr
dskvr / fjb.sh
Last active September 5, 2024 23:54
find bitcoin block number with a provided timestamp
#!/bin/bash
# USAGE:
# fjb.sh <timestamp>
# returns: <blocknum>
TIMESTAMP=$1
LOWER=0
UPPER=$(bitcoin-cli getblockcount)
@dskvr
dskvr / opensats-badge.md
Last active September 23, 2024 16:32
opensats.org badge

OpenSats.org Badge

Easy way to flag OpenSats. Gigi tell me which casing is preferred please. While OpenSats is "correct," badges tend to be all lower. Let me know.

Standard Label / rgb(249,115,22)

opensats.org

[![opensats.org](https://img.shields.io/badge/%3E__-opensats-rgb(249,115,22))](https://opensats.org)