Skip to content

Instantly share code, notes, and snippets.

View amilajack's full-sized avatar
🔨
Building @trypalette (hiring!)

Amila Welihinda amilajack

🔨
Building @trypalette (hiring!)
View GitHub Profile
@amilajack
amilajack / .gitignore
Created April 26, 2023 08:39 — forked from nicosingh/.gitignore
ECS using Terraform sample
View .gitignore
*.tfbackup
.terraform/
*.tfstate
.terraform.tfstate.lock.info
@amilajack
amilajack / git_cheat-sheet.md
Created April 15, 2020 19:40 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
View git_cheat-sheet.md
@amilajack
amilajack / esnextbin.md
Last active January 26, 2019 19:59
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created January 23, 2019 18:56
esnextbin sketch
@amilajack
amilajack / fft-math127.js
Created May 14, 2018 18:31
FFT MATH 127
View fft-math127.js
console.clear()
const l = 1;
const j = 1;
const m = 2;
const k = 2;
const d = 2;
const expression = []
@amilajack
amilajack / coordinating-async-react.md
Created September 19, 2017 02:07 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views
View coordinating-async-react.md

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

View es6-feature-detection.js
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}