- Storing multiple hypercores in a single "group"
- Purging storage for a given hypercore key
- Able to replicate whole group
- Specifying which key should be used for replication handshake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebRTC, unlike Dat, requires doing a handshake through a third party. | |
With beaker, that third party can be the existing P2P connections that you have. | |
To connect between two peers you need to do the following: | |
- Create a Dat Archive for the call website | |
- Listen on messages in the [dat-peers API](https://beakerbrowser.com/docs/apis/experimental-datpeers) | |
- Have the user enter a "room" | |
- Set up the WebRTC connection, send the SDP handshake and the `room` through datPeers | |
- When you get messages for your room, pass them to the local PeerConnection as being remote SDP or ICE |
Dat has a cool ecosystem with a bunch of different people working on interesting things. This is a list of what I'd like to have in an official Dat Toolbelt along with tutorials on how to use these tools.
- Files
- Create a file, share it with a
dat://
link
- Create a file, share it with a
- All archives should be multiwritable, with mounts / etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window._fetch = fetch | |
window.fetch = async function(url) { | |
if(url.startsWith("dat://")) { | |
const parsed = new URL(url) | |
const archive = await DatArchive.load(`dat://${parsed.hostname}`) | |
return { | |
text: async () => { | |
return archive.readFile(parsed.path, "utf8") | |
} | |
} |
A simple, lisp-like, and functional language for experimenting with making a language.
Variables are declared on the stack, declaring one can be done with the =
function.
Variables are marked as being constant upon being assigned, and cannot be reassigned again within the current function.
The assignment function takes two arguments, name:String
and value:Any
. Since it's just a function, you can pass in a variable for the name to have dynamically resolved names within the current scope.
Assigning to a variable example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = items:(pathStart pathEnd?) {return items[0].concat(items[1])} | |
pathStart = (items:(pathItem / singleParam / single)+) | |
pathEnd = item:(multiParam / multi / lastItem) {return item} | |
pathItem = text:pathName "/" {return {type: "text", content: text}} | |
lastItem = text:pathName "/"? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
( | |
[] 1337 "cats" dogs) | |
(+ 1 0xFF) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="A"> | |
<div> | |
Hello, I like <span class="B">cats</span>. | |
</div> | |
<div> | |
I like <span class="B">dogs</span>. | |
</div> | |
<div> | |
I prefer <span class="B">reptiles</span>. | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This calls the function whenever a primitive is needed | |
function R(fn){ | |
return { | |
valueOf:fn, | |
toString:function(){ | |
return fn()+""; | |
} | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FunNewsSubstitutions | |
// @namespace http://mauve.us.to | |
// @description This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox | |
// @include * | |
// ==/UserScript== | |
// Wrapper to keep things in their own scope | |
(function(){ | |