Skip to content

Instantly share code, notes, and snippets.

View alessbell's full-sized avatar

Alessia Bellisario alessbell

View GitHub Profile
@robrichard
robrichard / README.md
Last active June 2, 2023 14:47
defer-stream proposal 2023-04-14

Summary of the latest "no-overlapping-branches" proposal by @benjie & @robrichard

Features

  • No overlapping branching.
  • No duplicate delivery of any fields
  • Reduces the risk of response amplification
  • No complex WeakMap/similar caching shenanigans.
  • No query rewriting.
  • No look-ahead.
@leerob
leerob / settings.json
Created January 8, 2023 17:15
VSCode settings (2023)
{
// NORMAL SETTINGS
// ===============
"editor.quickSuggestions": {
"comments": "on",
"strings": "on",
"other": "on"
},
"editor.suggestOnTriggerCharacters": true,
"editor.wordBasedSuggestions": true,
@bholmesdev
bholmesdev / react-async-await-rfc-notes.md
Created October 15, 2022 18:22
React async / await RFC notes

React async-await RFC

What I know coming in

React server components (initial proposal) was a so-so DX that solved an important problem: I want to render a React component on the server only, with APIs to easily fetch data for rendering.

  • Pulls on islands architecture concepts (hi Astro.build!)
  • Improves full-stack ergonomics
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@phortuin
phortuin / signing-git-commits.md
Last active May 14, 2024 15:02
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@shuding
shuding / swr-suspense-journey.md
Created September 14, 2021 12:18
The Journey of SWR and Suspense

The Journey of SWR and Suspense

We are trying to combine the idea of SWR ("stale-while-revalidate") and React Suspense together, and this write-up covers all our findings from this journey.

Background

When React Hooks launched, people started to rely on useEffect to initiate data fetching:

function User () {
pico-8 cartridge // http://www.pico-8.com
version 29
__lua__
--hand cram
--by @andy_makes
--playable at https://andymakes.itch.io/hand-cram
--**********************************
--original, 557 char code
<LoadingButton
ariaErrorAlert={"There was an error creating your account"}
ariaLoadingAlert={
authState === AuthState.CreatingUser
? "Registering account, please wait..."
: authState === AuthState.FulfillingPurchase
? "Generating license, please wait..."
: "Loading..."
}
ariaSuccessAlert="Account created! Redirecting."
@sindresorhus
sindresorhus / esm-package.md
Last active May 24, 2024 02:36
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@threepointone
threepointone / durable-objects-001-fundamentals.md
Last active September 29, 2023 12:14
Notes on Durable Objects. Part 1 - Migrations.

Note: Since writing this, I've been pointed to some exciting new research/tooling called Project Cambria https://www.inkandswitch.com/cambria.html I'll likely have to rewrite this article taking that into account. Leaving this up for posterity's sake.


(This series isn't meant to be a primer/tutorial, though we might do something regarding it in the future. For official documentation and starters, see https://developers.cloudflare.com/workers/learning/using-durable-objects.

Further - these are my personal views; I expect to be wrong about a lot of them. Indeed, I'm not paying much attention to presenting these well at the moment, simply writing down thoughts. As such, expect these writeups to change often, particularly as the platform takes shape. I'm also mostly a front end guy, so don't get mad if I get it very wrong. Give me feedback! Always happy to learn and make changes.)

Durable Objects are a fascinating new storage primitive from cloudflare for their workers platform. There's a lot of 'cool'