Skip to content

Instantly share code, notes, and snippets.

Busy working on Alfred (

Amila Welihinda amilajack

Busy working on Alfred (
View GitHub Profile
amilajack /
Created Apr 15, 2020 — forked from davfre/
git commandline cheat-sheet
View fft-math127.js
const l = 1;
const j = 1;
const m = 2;
const k = 2;
const d = 2;
const expression = []
amilajack /
Created Sep 19, 2017 — forked from acdlite/
Demo: Coordinating async React with non-React views

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 {
} catch(e) {
alert('Your browser does not support ES6!')
amilajack / css-supports.js
Created Jan 29, 2017 — forked from codler/css-supports.js
CSS.supports() Polyfill
View css-supports.js
/*! CSS.supports() Polyfill
* Copyright (c) 2014 Han Lin Yap; MIT license */
if (!('CSS' in window)) {
window.CSS = {};
if (!('supports' in window.CSS)) {
window.CSS._cacheSupports = {};
window.CSS.supports = function(propertyName, value) {
You can’t perform that action at this time.