Skip to content

Instantly share code, notes, and snippets.

View okdistribute's full-sized avatar
📱
Hiring -- come do peer-to-peer at Ditto!

rae okdistribute

📱
Hiring -- come do peer-to-peer at Ditto!
View GitHub Profile
@okdistribute
okdistribute / package.json
Created January 8, 2022 21:09
Automerge Tutorial Server
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@okdistribute
okdistribute / main.go
Created August 1, 2020 18:54
utf go lameness
package main
import "fmt"
import "unicode/utf8"
func main() {
fmt.Println(len("Hello World"))
fmt.Println(utf8.RuneCountInString("Hello World"))
fmt.Println(len("读写汉字 - 学中文"))
fmt.Println(utf8.RuneCountInString("读写汉字 - 学中文"))
@okdistribute
okdistribute / package.json
Created April 6, 2020 01:19
kappa-workshop
{
"name": "kappa-workshop",
"description": "P2P collaboration workshop",
"license": "MIT",
"dependencies": {
"chalk": "^2.4.1",
"hypercore": "^8.3.0",
"kappa-core": "^6.0.0",
"kappa-view-kv": "^2.0.2",
"kappa-view-list": "^1.2.0",
@okdistribute
okdistribute / keybase.md
Created April 4, 2020 22:12
keybase.md

Keybase proof

I hereby claim:

  • I am okdistribute on github.
  • I am karissa (https://keybase.io/karissa) on keybase.
  • I have a public key ASCf1pJGg7DYvk-6KH7gaqfsJ7uA7pWuscDytYFMiec6yAo

To claim this, I am signing this object:

@okdistribute
okdistribute / keybase.md
Created March 26, 2020 03:28
keybase.md

Keybase proof

I hereby claim:

  • I am okdistribute on github.
  • I am okdistribute (https://keybase.io/okdistribute) on keybase.
  • I have a public key ASCEYDzgc9tqthxdO3YjlmXvtyyeGC0ccfde9g-v7b0Thwo

To claim this, I am signing this object:

@okdistribute
okdistribute / README.md
Last active May 4, 2017 17:28
dat.json dependencies

When I create a dat, it gives me a dat.json file. The dat.json file currently describes a single dat. For example,

From the existing dat.json spec:

{
  "url": "dat://37ad8eb8d7f...",
  "title": "This is My Dataset",
  "description": "This is a one or two line description of the archive for Human People",
  "author": "Karissa McKelvey <karissa@mckelvey.edu>"
}
@okdistribute
okdistribute / index.js
Last active January 28, 2019 08:29
dat with webrtc
var webrtc = require('webrtc-swarm')
var signalhub = require('signalhub')
var hyperdrive = require('hyperdrive')
var memdb = require('memdb')
var pump = require('pump')
var DEFAULT_SIGNALHUBS = 'https://signalhub.mafintosh.com'
var drive = hyperdrive(memdb())
var choo = require('choo')
var html = require('choo/html')
var app = choo()
const view = (state, prev, send) => {
function submitButton () {
console.log('hi')
}
test('prep', function (t) {
rimraf.sync(path.join(fixtures, '.dat')) // for previous failed tests
var myDat = dat(fixtures, function (err, node) {
t.error(err, 'no error')
shareDat = node
shareDat.once('key', function (key) {
console.log('THIS ONE HAPPENS')
shareKey = key
t.end()
})
const choo = require('choo')
const mainView = require('./main')
const app = choo()
app.model({
namespace: 'message',
state: {
server: 'rehydration has kicked in, server data was tossed',