Skip to content

Instantly share code, notes, and snippets.

@pfrazee
pfrazee / schemas-design-doc-draft.md
Created June 8, 2022 20:22
An initial draft proposal of record schemas for Bluesky's ADX project.

Schemas Design Doc (draft)

Please note: The following document is an initial draft proposal. All decisions are subject to change. Our present goal is to collect feedback and iterate upon this document. Please feel free to share your suggestions and concerns.

Overview

ADX is a federated network for distributing data. It leverages cryptographic signatures and hashes to distribute authenticity proofs along with the data, enabling each node to transact upon the data independently of the data's origin. ADX might therefore be described as an Internet-native database in which records are replicated across nodes.

As a consequence of relying on authenticity proofs, ADX must exchange "canonical" records. That is, ADX records must be transmitted in their original encoding and structure in order to validate the signatures and hashes which comprise the proofs. This stands in contrast to the RESTful model of the Web in which "representations" of records are exchanged and therefore may be constructed at the ti

@mcollina
mcollina / principles.md
Last active May 18, 2023 18:27
Matteo's Technical principles

Matteo Technical Principles

1. Conway’s Law is paramount.

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

In order to design a piece of software we need to “design” the team that is going to produce it.

2. Developer Experience is key to productivity

@nckroy
nckroy / eran-hammer-oauth2-rant-20120726.md
Created January 21, 2021 00:15
OAuth 2.0 and the Road to Hell

(Scraped from the Internet Wayback Machine. Original content by Eran Hammer / hueniverse.com July 26, 2012)

OAuth 2.0 and the Road to Hell

They say the road to hell is paved with good intentions. Well, that’s OAuth 2.0.

Last month I reached the painful conclusion that I can no longer be associated with the OAuth 2.0 standard. I resigned my role as lead author and editor, withdraw my name from the specification, and left the working group. Removing my name from a document I have painstakingly labored over for three years and over two dozen drafts was not easy. Deciding to move on from an effort I have led for over five years was agonizing.

There wasn’t a single problem or incident I can point to in order to explain such an extreme move. This is a case of death by a thousand cuts, and as the work was winding down, I’ve found myself reflecting more and more on what we actually accomplished. At the end, I reached the conclusion that OAuth 2.0 is a bad

const {isArray} = Array;
const sync = async values => {
for (let {length} = values, i = 0; i < length; i++) {
const value = await values[i];
values[i] = isArray(value) ? await sync(value) : value;
}
return values;
};
@WebReflection
WebReflection / my-libraries-in-bytes.md
Last active September 24, 2021 22:03
My libraries in bytes

Toward better libraries

I am recently re-branding my libraries as µ (micro), refactoring these when necessary, dropping IE < 11 support, improving the logic where possible, or providing a better, more robust, or faster, API.

In few words, on the right there is the modern version of libraries I've used for the last ~5 years in production or for side projects, and I suggest anyone having one of the earlier dependencies, to have a look at their modern, micro, counterpart.

How to read these tables

All sizes are minified, brotli compressed, and representing these two files, when possible:

@GoNZooo
GoNZooo / text.ts
Created December 24, 2018 21:48
Phantom type variant in TypeScript
interface PlainText extends String {
__plaintext__: never
}
interface Base64Encoded extends String {
__base64Encoded__: never
}
interface Encrypted extends String {
__encrypted__: never
}
@sarahmeyer
sarahmeyer / npm_eslint-scope_explainer.md
Last active July 14, 2018 16:50
explainer of the july 12 2018 npm/eslint vulnerability

What happened to npm yesterday?

This morning, soon after I got to work, one of my favorite coworkers sent me a direct message on Slack. They had heard a lot of discussion yesterday in our internal #front-end-devs channel about a malicious script making its way into an npm package called eslint-scope. After following the chat and reading the issue report on Github, they could tell that the attack exposed a vulnerability in the npm package ecosystem, and that the purpose of it was to harvest the contents of .npmrc files. They had a simple question:

why would someone steal npm credentials? what are they good for?

This coworker of mine is very smart, and if they didn't know the answer to this question, I thought it might be possible that other folks didn't know it, either.

What did the attacker try to steal?

@brzez
brzez / hapi.sse.js
Created July 5, 2018 05:59
hapi 16 sse
// @flow
import {PassThrough} from 'stream';
class SSEStream extends PassThrough {
_compressor = null;
_read (size) {
super._read(size);
if (this._compressor) {
@nagyv
nagyv / 1 - readme.md
Created June 3, 2018 19:58
using Nes with Schmervice

This is a simple example to use Nes with Schmervice in hapipal-like project.

As there might be several susbcription channels, I prefer to separate them by domain, and have a single service that handles all the even passing between different parts of the code.

Example usage:

  // somewhere in a router's handler
@oconnor663
oconnor663 / bad_git.sh
Created October 4, 2017 17:02
edit a git commit without changing the hash
#! /bin/bash
d="$(mktemp -d)"
# Make a git repo with one file in it.
mkdir "$d/good"
cd "$d/good"
git init
echo good > file.txt
git add -A