Skip to content

Instantly share code, notes, and snippets.

View DougAnderson444's full-sized avatar
🕸️
Open Web, all the way

Doug A DougAnderson444

🕸️
Open Web, all the way
View GitHub Profile
@samuelclay
samuelclay / radix_trie.js
Created January 30, 2013 16:55
A Radix Trie (aka PATRICIA trie) implemented in JavaScript. Play with it at this interactive JS fiddle: http://jsfiddle.net/jCYAw/
var RadixTrie = function(words) {
this.T = {};
this.initialize(words);
};
RadixTrie.prototype = {
initialize: function(words) {
var self = this;
words = words || [];
@subfuzion
subfuzion / curl.md
Last active April 23, 2024 14:44
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@cmgiven
cmgiven / .block
Last active March 17, 2024 03:17
Rectangular Collision Detection
license: mit
@ncochard
ncochard / babel-webpack.md
Last active September 29, 2023 05:15
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@gliheng
gliheng / .cargo|config
Last active January 20, 2021 16:16
export rust function to javascript using cwrap
[target.wasm32-unknown-emscripten]
rustflags = [
"-Clink-args=-s EXPORTED_FUNCTIONS=['_draw'] -s ASSERTIONS=1",
]
@ralfr
ralfr / iota_zmq.js
Created January 11, 2018 13:55
IOTA ZeroMQ Snippet
const zmq = require('zeromq')
const config = require('./config')
var sock = zmq.socket('sub')
sock.connect('tcp://' + config.zmq_url)
sock.subscribe('')
sock.on('message', function(topic) {
@ow
ow / Chromium flags for PWAs.md
Last active January 27, 2021 23:42
Chromium flags for PWAs

Upcoming flags to enable link capturing and other PWA features. Enable these flags by copying and pasting the following, then searching for the below chrome://flags/

Enable full desktop integration:
chrome://flags/#enable-desktop-pwas

Capture URLs in their scope, such as twitter URLs for the Twitter PWA:
chrome://flags/#enable-desktop-pwas-link-capturing chrome://flags/#enable-desktop-pwas-stay-in-window

Get a pop-up that offers to allow the PWA to open certain URLs:

@paulmillr
paulmillr / BLS_Signature.md
Last active March 2, 2024 14:44
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@andrewosh
andrewosh / README.md
Created May 11, 2020 02:44
A smal,l end-to-end example of using Hyperdrive/Hyperswarm to replicate a drive

Note: To keep this even smaller, we're using a small helper module called the hyperswarm replicator, which wraps a few Hyperswarm setup details.