Skip to content

Instantly share code, notes, and snippets.

View kl0tl's full-sized avatar

Cyril Sobierajewicz kl0tl

View GitHub Profile
@dead-claudia
dead-claudia / non-linear-control-flow.md
Last active May 1, 2017 15:47
A powerful non-linear control flow proposal unifying both Promise and Observable operations for highly expressive control flow and parallelism, inspired by non-Von Neumann models

Edit: The proposal now lives here, and this below is generally out of date.


Non-linear Control Flow

Asynchrony is hard. Modeling it is not super intuitive in most languages, JavaScript being no exception for the longest time. But we have been making progress:

  1. Callbacks give us the base concept, thanks to lambda calculus.
@paulirish
paulirish / what-forces-layout.md
Last active June 19, 2024 15:52
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@tel
tel / ProfunctorLens.js
Last active October 23, 2023 20:32
Pure Profunctor Lenses in Javascript (redux)
/* eslint-disable new-cap */
/**
* Lens types.
* ===========
*
* a * b = {fst: a, snd: b}
* a + b = {index: Boolean, value: a | b}
*
* Iso s t a b = forall (~>) . Profunctor (~>) => (a ~> b) -> (s ~> t)
@xmlking
xmlking / bower.json
Last active August 29, 2015 14:00
Angular Gulp workflow with SASS and Traceur for ES6 -> ES5
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"main": "app/index.html",
"dependencies": {
"jquery": "jquery/jquery",
"angular": "1.3.0-beta.5",
"es6-shim": ">=0.8.0",
"bootstrap-sass-official": "~3.1.1",