Created with
- Node 14.15
- THREE.js r124
- headless-gl 4.9.0
Make sure you install headless-gl's dependencies, then run with XVFB like so:
# https://blog.notryan.com/server.py | |
# https://www.reddit.com/r/programming/comments/gdxh3w/http_blog_server_100_lines_of_c_in_a_closet/fpkqvqw/ | |
import socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.bind(("0.0.0.0", 8080)) | |
sock.listen(1) | |
while True: |
Created with
Make sure you install headless-gl's dependencies, then run with XVFB like so:
Run this code using Deno:
deno run https://gist.githubusercontent.com/crabmusket/2c8c6e692974edd56cd6ab8fee14addd/raw/869958a7094daf17b36be6ac078aa0eafb4b0a9d/benchmark.js
It will prompt you for two network permissions, to download the sample data files.
An example of results from my laptop:
This set of helpers makes it easy to communicate with an iframe via JSON RPC.
This gist contains both the TypeScript source code, and a stripped JavaScript version.
If you have an iframe on your page you want to communicate with, download the source code and use it like so:
import {makeRpcClient, makeRpcServer} from "./framerpc.js";
// Modify an object, passing an explicit key array. The callback only has access to the keys in the array. | |
function modify<T, K extends keyof T>(instance: T, keys: K[], update: (v: Pick<T, K>) => void) { | |
const draft = structuredClone(instance); | |
update(draft); | |
// for example's sake, just log the changed keys | |
for (let k of keys) { | |
console.log("updated", k, "from", instance[k], "to", draft[k]); | |
} | |
} |
https://superuser.com/a/1415765
The wget command you'll need to use is much lengthier as explained below. As such, you may wish to commit it to a file like wholesite.sh, make it an executable, and run it. It'll create a directory of the url and subdirectories of the site's assets, including images, js, css, etc.
wget \
--recursive \
--level 5 \
--no-clobber \
--page-requisites \