Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
Decentralizing

RangerMauve

💜
Decentralizing
View GitHub Profile
@staltz
staltz / introrx.md
Last active Jun 14, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
View 0-bridging-react-native-cheatsheet.md
@crtr0
crtr0 / client.js
Created Jun 8, 2012
A simple example of setting-up dynamic "rooms" for socket.io clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@gubatron
gubatron / dht-walkthrough.md
Last active Jun 1, 2021
DHT walkthrough notes
View dht-walkthrough.md

DHT Walkthrough Notes

I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.

What problem does this solve?

400,000,000,000 (400 billion stars), that's a 4 followed by 11 zeros. The number of atoms in the universe is estimated to be around 10^82. A DHT with keys of 160 bits, can have 2^160 possible numbers, which is around 10^48

@jarretmoses
jarretmoses / React Native Clear Cache
Last active May 8, 2021
Clearing the Cache of your React Native Project
View React Native Clear Cache
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@P4
P4 / default.reg
Last active May 6, 2021
Color schemes for Windows Command Prompt
View default.reg
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@nybblr
nybblr / 1-easy.js
Last active Apr 8, 2021
3 examples of using Async Generators and Async Iteration in JavaScript!
View 1-easy.js
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
View join-the-dht-cult.md

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
@i-infra
i-infra / appropriate_phone_infra.md
Last active Feb 18, 2021
How to get a (GVoice) phone number that you can use, safely, to interact with strangers, online. [2021]
View appropriate_phone_infra.md

Appropriate Phone Infra (Operational GVoice) v0.9.0

Public Release Feb17, 2021.

Copyright 2021, AKA Infra

Released under Creative Commons by Attribution 4.0 International (CC BY 4.0)

You are free to:

  • Share — copy and redistribute the material in any medium or format
@qwtel
qwtel / whatwg-stream-to-async-iterable.ts
Created Oct 12, 2020
Convert WHATWG web streams to async iterables and back
View whatwg-stream-to-async-iterable.ts
export async function* streamToAsyncIterable<T>(stream: ReadableStream<T>): AsyncIterableIterator<T> {
const reader = stream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done) return;
yield value;
}
} finally { reader.releaseLock() }
}