Skip to content

Instantly share code, notes, and snippets.

@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"]
}
@SnowCait
SnowCait / NostrTextUploader.md
Last active April 23, 2024 13:51
Nostr テキストアップローダー

概要

画像アップローダーとほぼ同じ。

メリット

  • 削除可能
  • 編集履歴
  • NIP-98 認証 → フォローユーザーに限定することで鍵垢の実装が可能
@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"
--- 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;
@danieltorscho
danieltorscho / on-merge-deploy-to-do.md
Last active June 21, 2024 10:04
GitHub Actions deploy nodejs to DigitalOcean Droplet

Github deployment

Requirements:

  • DigitalOcean Droplet (Ubuntu 20.04+) should be created
  • Github repository

Prepare DO Droplet Server:

  • ssh root@DROPLET_IP
  • sudo vi /etc/ssh/sshd_config
  • change PasswordAuthentication from no to yes
@areknawo
areknawo / LazyHydrate.vue
Created August 13, 2021 11:18
Vue 3 lazy hydration component
<script lang="ts">
import { defineComponent, onMounted, PropType, ref, watch } from "vue";
type VoidFunction = () => void;
const isBrowser = () => {
return typeof window === "object";
};
export default defineComponent({
props: {
@BrendonKoz
BrendonKoz / leaflet-darkmode.md
Last active June 4, 2024 03:20
Automatic Dark Mode for Leaflet.js
// Leaflet JS - note the *className* attribute
// [...]

L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
    className: 'map-tiles'
}).addTo(map);

// [...]
swagger: '2.0'
info: {title: ClickUp 2.0, version: ''}
host: api.clickup.com
basePath: /api/v2
schemes: [https]
paths:
/task/{task_id}/attachment:
post:
responses:
'200':
@shellkore
shellkore / squah.md
Created January 18, 2019 17:54
squash your commits

SQUASH

Whenever you want to squash last commits in a single commit:-

first check your log

git log

CASE 1: your head is at the commit in which you want others to be squashed

@ThomasR
ThomasR / websocket-debugger.user.js
Last active September 17, 2020 15:54
A userscript that provides simple websocket inspection e.g. in for Firefox (works in Chrome too)
// ==UserScript==
// @name Websocket debugger
// @namespace thomas-rosenau.de
// @version 1
// @grant none
// @include *
// @run-at document-start
// ==/UserScript==
((main) => {