View unfuckReact.js
const mounted = new WeakSet()
export default const unfucker = (component, displayName = component.displayName || || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
this.state = {}
component.apply(this, arguments)


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 calendar.es6.js
const calendar = {
controller : ( date = moment() ) => {
const weeks = []
const end = date.endOf( 'month' ).startOf( 'week' )
let current = date.startOf( 'month' ).startOf( 'week' )
do {
weeks.push( {
start : current.clone()
View fileInput.css
.fileContainer {
overflow: hidden;
position: relative;
.fileContainer [type=file] {
cursor: inherit;
display: block;
font-size: 999px;
filter: alpha(opacity=0);

Mithril debugger

Prioritised features:

  1. Pointer-based hover-overlay to highlight elements generated by Mithril
  2. With a view of their corresponding vnode & associated path
  3. That allows travel through path and vnode tree interface to highlight other elements

Followed by:

  • Patch reporter:
    • Receive inspectable logs for changes that occur on render
View detectCSS.js
// Is the passed CSS property supported?
// eg. detectCSS('transition')
function detectCSS(prop){
prop = prop.replace(/-(\w)/g,function(s,g){return g.toUpperCase()}),
pre = ',Icab,Khtml,Moz,Ms,O,Webkit'.split(',');
for (var i = 0; i < pre.length; ++i){
prop = prop.slice(0,1).toUpperCase() + prop.slice(1);
View jquery.whichclick.js
void function whichClickClosure( $ ){
var events = {
1 : 'leftclick',
2 : 'middleclick',
3 : 'rightclick'
// List of interruption events for symbolic linking between custom and native events
interrupts = [

There are many scenarios where a particular interaction makes repeated calls to an asynchronous, and each subsequent call invalidates the previous. For example, typing in a field which can query an HTTP service for insights: if I type 'a', and wait long enough, a call should be sent to ask for pertinent suggestions; but if I'm still waiting on that response when I type 'b', then the results of the last call are impertinent. Only the last call's response should resolve.

Calling latest creates a 'promise debouncer' function. Either you pass in the async function there and then and call it without arguments, or you instantiate it empty and pass in the async function upon request. In either case, calling the function before its last promise has resolved will ensure that promise never resolves: only the last request will ever resolve.

View BornToDie.js
const BornToDie = v => {
born = true,
to = false,
die = false,
let query
let draw