Skip to content

Instantly share code, notes, and snippets.

View optimalisatie's full-sized avatar

PageSpeed.pro optimalisatie

View GitHub Profile
@optimalisatie
optimalisatie / lazy-instant-render.js
Last active December 25, 2022 09:04
Image lazy loading with instant visibility of in-view images on page load (MutationObserver)
// Performance tests such as Google Lighthouse often complain about below the fold images while lazy loading
// techniques may introduce a flash effect for images on bigger screens
// This snippet shows a solution to instantly display images as if loaded using src="" while maintaining
// the lazy loading benefit on smaller screens.
// Tip: a second and potentially better technique is to rewrite lazy loaded images to regular src="" images in a Service Worker.
// this snippet depends on in-view (5kb)
// @link https://github.com/camwiegert/in-view/
@jimmywarting
jimmywarting / readme.md
Last active June 24, 2024 15:39
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@swannodette
swannodette / reactpersist.md
Created May 28, 2015 19:17 — forked from chenglou/gist:34b155691a6f58091953
Persistent React Component Problem

key is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:

  • Clone state
<Comp key={1} /><Comp key={1} />
  • Preserve component state across different parents: