Skip to content

Instantly share code, notes, and snippets.

View jwerle's full-sized avatar
🔨
Working on @socketsupply/socket

Joseph Werle jwerle

🔨
Working on @socketsupply/socket
View GitHub Profile
@garth
garth / readme.md
Last active January 18, 2024 21:58
A Yjs provider for socketsupply

You can use it the same as you do with other yjs providers, but you have to pass it a socket which can be created with someting like this:

// set the peer id
const peerId = window.localStorage.getItem('peerId') ?? (await Encryption.createId())
window.localStorage.setItem('peerId', peerId)

// set the signing keys
const keySeed = window.localStorage.getItem('keySeed') ?? createId()

Hey Kyle, enjoyed the discussion, especially the stuff you're doing at socket supply.

I'm definitely a fan of decentralization. Building the decentralized internet is one of the main plot points of HBO's Silicon Valley, and even though it's comedy, it definitely resonated as a good idea.

In this decentralized model, how do you replicate some of the advantages of the cloud though? Redundancy, reliability, latency improvements from having multiple cloud regions? The decentralized social network example, that puts a huge amount of responsibility on the users, most of whom are not tech savvy, to maintain multiple backups of their data to prevent loss of say their photos, which is presently solved for them by having them backed up to icloud or Instagram or whatever.

I think in the silicon valley show, they built the decentralized internet by essentially making the entire p2p network a fault tolerant, redundant distributed data store. It would need some smart solutions for identity and access manageme

Hyperswarm DHT setup

Checking your network for P2Pness

Running a node

Running a dht node is as simple as installing the DHT cli.

npm i -g @hyperswarm/cli
@kripken
kripken / hello_world.c
Last active January 17, 2024 12:15
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@AlexTalks
AlexTalks / vim-gui-server
Last active August 29, 2015 14:10
GVIM Wrapper! One TTY one GVIM window...
# GVIM Wrapper!
# Usage: gvim [option] [file...] open files, tabbed, in a shared window (default one per terminal)
# Options: (only one can be used)
# -d, --dir Open files in a window specific to the current working directory
# -n, --normal Execute command without server arguments
# -s, --server <name> Open files in the window named <name>
# --print Print command with full arguments
# --usage Print this message and exit
vim-gui-server() {
local PROGRAM="$1"
define([
// jquery core is always required
'jquery/core',
// jquery utilities
'jquery/ajax',
'jquery/data'
], function(jq, ajax, data) {
#!/bin/bash
# git-recent
#
# Call 'git fetch' and log all remote branches that have any activity
# in the past n days (default=3).
#
# Place this script in your PATH, chmod +x it, and git will allow you to magically do:
# $ git recent (days)
#
@jwerle
jwerle / push.sh
Last active January 1, 2016 03:19
Push messages to a browser with `umq(1)` and `wscat(1)` via web sockets
#!/bin/sh
PORT=5000
## accept data from stdin
while read -r chunk; do
echo "$chunk" | umq push localhost $PORT
done
@jwerle
jwerle / cpu-stream.sh
Last active September 11, 2019 10:47
Stream CPU usage with `umq(1)' to a `histo(1)' histogram. See `umq(1)': https://github.com/jwerle/umq See `histo(1)': https://github.com/visionmedia/histo
#!/bin/bash
# ps -eo pcpu,pid,user,args | sort -r -k1
PS="ps"
VERSION="0.0.1"
version () {
echo $VERSION
}
@stephenmathieson
stephenmathieson / ie8-tables-and-colons.js
Created December 11, 2013 19:12
IE8 incorrectly reports `Object#hasOwnProperty(<table>, ':')` as true
// Element#hasOwnPropery doesn't exist in IE8
var has = Object.prototype.hasOwnProperty;
var table = document.createElement('table');
alert('this browser sucks: ' + has.call(table, ':'));