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
@spite
spite / WebGL NFT
Last active November 5, 2021 02:01
Base to make WebGL interactive shaders
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>WebGL NFT</title>
<meta
name="viewport"
content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<meta property="og:image" content="thumbnail.png" />
@nicosingh
nicosingh / .gitignore
Last active March 18, 2024 08:34
ECS using Terraform sample
*.tfbackup
.terraform/
*.tfstate
.terraform.tfstate.lock.info
@pcwalton
pcwalton / webrender-benefits.md
Created January 17, 2019 00:18
WebRender benefits

WebRender benefits

Fundamentally, WebRender is designed to render CSS with better performance on modern hardware than what the traditional combination of a legacy painting API like Skia and a compositor can offer. It does so by merging the painting and compositing steps together into a single API, avoiding the performance pitfalls associated with CSS properties that don't run on the compositor. Instead of an immediate mode API in which objects are rendered back-to-front, WebRender uses a retained mode API that can render objects in any order. Ultimately, WebRender works more like a game engine than a legacy PostScript-like 2D API, which is

@acdlite
acdlite / coordinating-async-react.md
Last active March 20, 2022 12:27
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?

@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 18, 2024 09:44
Swift Concurrency Manifesto
@andywer
andywer / talk-proposal.md
Last active December 23, 2020 17:22
Reactive Conf 2017 ⚡️ Talk Proposal - Memory Leak Hunt 2017 Style

This is a proposal for lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!

Memory Leak Testing in 2017

Hi, I am Andy, creator of leakage - the node-powered memory leak testing library.

Instead of manual debugging it provides a structured approach to fix or even prevent memory leaks.

@andywer
andywer / dctypes.js
Created March 4, 2017 16:24
Babylon plugin for elm/haskell-ish type declarations
// src/plugins/dctypes.js
import { types as tt } from "../tokenizer/types";
import { types as ct } from "../tokenizer/context";
import Parser from "../parser";
import "./flow";
const pp = Parser.prototype;
export default function (instance) {
@addyosmani
addyosmani / preprocessing.md
Last active January 17, 2023 17:07
JavaScript preprocessing/precompilation

Problem: How can we preprocess JavaScript (at build-time or on the server-side) so engines like V8 don't have to spend as much time in Parse? This is a topic that involves generating either bytecode or a bytecode-like-abstraction that an engine would need to accept. For folks that don't know, modern web apps typically spend a lot longer in Parsing & Compiling JS than you may think.

  • Yoav: This can particularly be an issue on mobile. Same files getting parsed all the time for users. Theoretically if we moved the parsing work to the server-side, we would have to worry about it less.
  • One angle to this problem is we all ship too much JavaScript. That's one perspective. We could also look at preprocessing.
  • We've been talking about this topic over the last few weeks a bit with V8. There were three main options proposed.
    1. Similar to what optimize-js does. Identify IIFEs and mark them as such so the browser and VMs heuristics will catch them and do a better job than today. optimize-js only tackles IIFE bu

Motivation

  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small

Examples

Write in an expression-oriented style, scoping variables as locally as possible:

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!')
}