Skip to content

Instantly share code, notes, and snippets.

@pomber
pomber / bleeding-thread.js
Last active October 13, 2019 20:13
Run this to display the health of the main thread. Long red lines means that the main thread was busy for a long time.
(function(frames = 200, colWidth = "2px") {
const container = document.createElement("div");
container.style.position = "fixed";
container.style.right = "10px";
container.style.top = "0";
container.style.zIndex = "99999";
for (let i = 0; i < frames; i++) {
const fc = document.createElement("div");
fc.style.background = "red";
fc.style.width = colWidth;
@pizzarob
pizzarob / 01_DropZone.jsx
Last active November 14, 2017 08:28
HTML5 Drag and Drop File Upload React Component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const ANIMATION_DURATION = 1000;
class BatchDropZone extends React.Component {
static propTypes = {

Cheat sheet for callable entities in ES6

Value:

FD FE AF C M
Function-callable ×
Constructor-callable × ×
Prototype F.p F.p F.p SC F.p
Property prototype × ×
@staltz
staltz / introrx.md
Last active July 6, 2024 17:07
The introduction to Reactive Programming you've been missing
@dconnolly
dconnolly / README.md
Last active June 7, 2024 07:42
All 100 Chromecast background images that are rotated through, linked to their original locations on Google hosting. Links to 2560 width versions, where available.
@mxriverlynn
mxriverlynn / onShow.js
Created June 5, 2012 03:52
onShow promise for Marionette child views in a collection view
ItemView = Marionette.ItemView.extend({
// ...
onShow: function(){
// I am guaranteed to be called from the CollectionView
// because the CollectionView registers me in a promise
}
});
CollectionView = Marionette.CollectionView.extend({
@gerhard
gerhard / Gemfile
Created April 25, 2012 11:01
guard-mocha
source 'http://rubygems.org'
gem 'guard'
gem 'guard-shell'
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts