Skip to content

Instantly share code, notes, and snippets.

View millette's full-sized avatar

Robin Millette millette

View GitHub Profile
@paulmillr
paulmillr / active.md
Last active July 15, 2024 10:55
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@jonjaques
jonjaques / bookmarklet.js
Last active May 5, 2024 21:07
jQuery Bookmarklet Template w/ Async Loading
// You create your bookmarklet by instantiating
// a new Bookmarklet function, then pass in the options like so.
// This example checks to see if the var is already defined, and makes
// sure not to overwrite it. This could happen if the user clicks on
// the bookmarklet more than once.
MyBookmarklet = MyBookmarklet || (MyBookmarklet = new Bookmarklet({
// debug: true, // use debug to bust the cache on your resources
css: ['/my/style.css'],
js: [],
@dominictarr
dominictarr / signatures.md
Created August 18, 2014 08:16
use of signatures in secure datastructures

Camlistore is a simple secure datastructure, but it uses signatures in a way that exposes it to implicit trust. camlistore uses one way hashes to link json objects to make immutable datastructures, this is completely fine. But camlistore also uses signatures to make mutable datastructures, but this isn't done in a completely safe way.

To make a mutable datastructure a camlistore user creates a permanode this is just a json object with some entropy in it, and a pointer to the owner (the key who will sign updates). Then, the permanode owner can create claims (which are just signed json objects, that point back at the permanode) with which add or remove attributes from the permanode (things like set a key, or remove a key, add tags, or add something to a set)

Since claims are signed, it's infeasible for an attacker to forge a claim.

@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
const ABORTABLE_ERROR_KEY = '__abortablePromise';
/**
* @typedef {Promise.<*>} AbortablePromise
*
* @property {function} abort Additional method for abort original promise
*/
/**
*
@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active July 15, 2024 16:51
webRTC stun / turn server list
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@joehand
joehand / dat-bags.md
Last active June 10, 2017 18:35
bagit + dat thinking

There can be two versions of a Dat Bag:

  1. "Holey" Bag - meant for archviving of metadata at specific Dat archive version.
  2. Complete Bag - a complete backup of an archive checkpoint.
  3. Serialized Bag - this would be for bag with Dat without having Dat stuff inside the bag

Holey Dat Bag:

A "Holey" bag contains a fetch.txt file which points to where to download the rest of the data if file is not in data/ payload.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 20, 2024 23:50
Hyperlinks in Terminal Emulators

Can we create a smart contract VM on nodejs using Dat?

Ethereum is a trustless network of VMs which run smart contracts submitted by users. It uses proof-of-work to synchronize state across the network, and has every node execute the contracts in order to verify the state's validity. Each transaction is stored in the blockchain for replayability. Read more about it here.

Ethereum's "trustless network" model has some disadvantages:

  • Transaction processing is slow - it maxes at roughly 25tx/s right now for all contracts combined.
  • Every transaction costs money to execute.
  • The entire blockchain state must be shared across the computing network.
  • No private transactions.