function useTimeout(ms = 0) {
const [ready, setReady] = React.useState(false);
React.useEffect(function () {
const int = setTimeout(() => setReady(true), ms);
return () => clearTimeout(int);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple firework plugin — Play with options! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rateLimit(limitCount, limitInterval, fn) { | |
var fifo = []; | |
// count starts at limit | |
// each call of `fn` decrements the count | |
// it is incremented after limitInterval | |
var count = limitCount; | |
function call_next(args) { | |
setTimeout(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unobstrusive transition between A and B DOM elements through a third one C | |
Principle, for example transition A -> B: | |
1. make a clone of A | |
2. hide A and B | |
3. apply B styles to the clone (with transition) | |
4. once transition end, remove clone and reveal A and B back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function walkTheDOM(node, func) { | |
func(node); | |
node = node.firstChild; | |
while (node) { | |
walkTheDOM(node, func); | |
node = node.nextSibling; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
variables: | |
a = 5em | |
2.5em = a / 2 | |
*/ | |
.cube, | |
.cube > * {display:block; width:5em; height:5em;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moving around google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** ======================================================================= | |
* Vincent Hardy | |
* License terms: see svg-wow.org | |
* CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
* ======================================================================= */ | |
YUI.add("camera", function (Y) { | |
/** | |
* Constructor. A <code>Camera</code> makes it easy to move the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"asset" : { | |
"generator" : "Khronos glTF Blender I/O v1.7.33", | |
"version" : "2.0" | |
}, | |
"scene" : 0, | |
"scenes" : [ | |
{ | |
"name" : "Scene", | |
"nodes" : [ |