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
/** | |
* Inspired by ebidel@ (https://gist.github.com/ebidel/1b418134837a7dde7d76ed36288c1d16) | |
* @author surma@ | |
* License Apache-2.0 | |
*/ | |
function* collectAllElementsDeep(selector = '*', root = document.all) { | |
for (const el of root) { | |
if (!el.matches(selector)) | |
continue; |
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
#!/bin/bash | |
docker run --rm -v $(pwd):/src trzeci/emscripten emcc \ | |
-O0 `# leave uncompressed for example` \ | |
-s WASM=1 \ | |
-s EXPORTED_FUNCTIONS="['_hello']" \ | |
-s EXTRA_EXPORTED_RUNTIME_METHODS="['cwrap']" \ | |
-o emscripten-module.js \ | |
--post-js module-post.js \ | |
hello.c |