Skip to content

Instantly share code, notes, and snippets.

View jwerle's full-sized avatar
🔨

Joseph Werle jwerle

🔨
View GitHub Profile
@juliangruber
juliangruber / README.md
Last active March 24, 2021 02:00
lightweight node-websocketd

node-websocketd

A lightweight node port of websocketd, originally written in go.

Usage

node-websocketd --port=8080 ./count.sh
@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, ':'));
@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
}
@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
#!/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)
#
define([
// jquery core is always required
'jquery/core',
// jquery utilities
'jquery/ajax',
'jquery/data'
], function(jq, ajax, data) {
@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"
@kripken
kripken / hello_world.c
Last active August 13, 2026 06:49
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}

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

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