View fileInput.css
.fileContainer {
overflow: hidden;
position: relative;
.fileContainer [type=file] {
cursor: inherit;
display: block;
font-size: 999px;
filter: alpha(opacity=0);


Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked

// ...or vice versa
View conditional_fragment.jsx
import React from 'react';
import Input from './Input.js';
const InputGroup = props => (
{props.inputHasLabel &&
View unfuckReact.js
const mounted = new WeakSet()
class unfucked extends React.Component {
this.state = {}
View EventComponent.js
// EventComponents have a `handlers` hash which they can use to listen for DOM events on the document.
// These are bound and unbound safely to avoid lifecycle race condition exceptions.
export default class EventComponent extends React.Component {
componentDidMount() {
for(const key in || {})
componentWillUnmount() {
for(const key in || {})
View patdj.js
function patdj(target, update, preserve = true) {
if (update.nodeType != 1 && update.nodeType == target.nodeType)
target.nodeValue = update.nodeValue
else if (update.nodeType != target.nodeType || update.tagName !== target.tagName || update.type !== target.type){
const { nextSibling, parentNode } = target;
const replacement = preserve ? update.cloneNode(true) : update;
View Drag.js
import m from 'mithril'
import {stream} from 'flyd'
import PointerStream from 'pointer-stream'
// The component state object is provided wholesale for the author API, therefore we store our internal API state in a Map
const= new Map()
// Bind a temporal vnode to the private store associated with its persistent state
// This allows us to reliably access the last render's dom and attribute data
function update(vnode){
View component.js
componentDidMount() {
fetchPosts().then(({posts}) => {
fetchComments().then(({comments}) => {
View stalling-list.1684.js
export default {
onbeforeupdate(now, then){
const keys ={key}) => key)
const departed = then.children.filter(({key}) => !keys.includes(key))
return true
const departures = =>
View animator.js
var animating = false;
// Define an animator consisting of optional incoming and outgoing animations.
// alwaysAnimate is false unless specified as true: false means an incoming animation will only trigger if an outgoing animation is also in progress.
// forcing dontClone to true means the outward animation will use the original element rather than a clone. This could improve performance by recycling elements, but can lead to trouble: clones have the advantage of being stripped of all event listeners.
function animator( incoming, outgoing, alwaysAnimate, dontClone ){
// The resulting animator can be applied to any number of components
return function animate( x, y, z ){
var config;
var parent;