Skip to content

Instantly share code, notes, and snippets.

@MilllerTime
MilllerTime / logMethodCalls.js
Created July 24, 2020 04:44
Augments all methods on a given object to log a message to the console when called.
/**
* Augments all methods on a given object to log a message to the console when called.
* Useful for understanding how objects are used during an application's lifecycle.
*
* @param {string} baseName Logged as the indentifer before called method names.
* @param {object} target The object with methods that should be monitored for calls.
*
* @return {object} Returns the modified target object.
*/
function logMethodCalls(baseName, target) {
@MilllerTime
MilllerTime / base.css
Created November 21, 2018 22:26
Some ideas to apply as base CSS rules for new projects.
html {
box-sizing: border-box;
cursor: default;
font-family: system-ui, sans-serif;
text-size-adjust: none;
-webkit-tap-highlight-color: transparent;
}
*,
*::before,
@MilllerTime
MilllerTime / Pointable.jsx (MOVED TO REPO)
Last active April 7, 2017 16:10
A React component supporting dynamic pointer events. See comments for usage examples. Compatible with the official pointer events polyfill (https://github.com/jquery/PEP)
///////////////////////////////////////////////////////////////////////////
// //
// MOVED PERMANENTLY TO https://github.com/MilllerTime/react-pointable //
// //
///////////////////////////////////////////////////////////////////////////
// Allows listening for pointer events using PEP for browsers that don't support them.
// This component also adds support for dynamic event addition/removal that React does well,
// even though React doesn't support any pointer events yet.