Skip to content

Instantly share code, notes, and snippets.


Bret bcomnes

View GitHub Profile

On some files that are missing duration, parsing metadata is very slow.

View dependencygraph1.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bcomnes / .gitignore
Last active Sep 13, 2017
sticky tables
View .gitignore
View twitter-comp.js
var Nanocomponent = require('nanocomponent')
var html = require('bel')
var onIdle = require('on-idle')
var url = require('url')
var TwitterWidgetsLoader = {
src: '//',
loading: false,
listeners: [],
interval: 50,
View gist:47963cdb3de826afff321836d9f5723c
Dom Event scheduling
<yoshuawuyts> bret: the order of resolution per tick is:
16:18 bret: 1. microtasks; they're part of promises and mutationobservers but you can hook into them. See
16:18 bret: 2. setTimeout(cb, 0) calls
16:18 bret: 3. requestAnimationFrame() calls
16:19 <bret> Bret Comnes is that all of them?
16:19 <yoshuawuyts> bret: now this is where it gets tricky. If there is any rendering, it'll happen now. If there is none, setTimeout() and RAF will resolve _again_ on the same tick. Not sure about microtasks but suspect them too
16:19 bret: but assuming we modified the dom:
16:20 bret: 4. the render pipeline triggers here. E.g. paints and reflows
View gist:e517d2d2ac16cdc9f30c150e7c5773d3
Yoshua Wuyts 9:36 AM
Todd Kennedy joined group chat.
Todd Kennedy left group chat.
Todd Kennedy joined group chat.
Todd Kennedy left group chat.
Todd Kennedy joined group chat.
To list all available commands enter "/?".
View from-buffer.js
var from = require('from2')
exports.fromBuffer = fromBuffer
function fromBuffer (buffer) {
return from(function (size, next) {
if (buffer.length <= 0) return next(null, null)
var chunk = buffer.slice(0, size)
buffer = buffer.slice(size)
next(null, chunk)
bcomnes / .gitignore
Last active May 15, 2017
electron-builder yarn sqlite3 bug
View .gitignore
bcomnes / .gitignore
Last active Jul 3, 2017
View .gitignore
View postcss.config.js
module.exports = {
use: [
input: 'index.css',
output: 'dist/bundle.css',