Skip to content

Instantly share code, notes, and snippets.

View EchoZhaoH's full-sized avatar
📸
🤔

Echo EchoZhaoH

📸
🤔
View GitHub Profile
@EchoZhaoH
EchoZhaoH / douglasPeucker.js
Created January 5, 2023 01:31 — forked from adammiller/douglasPeucker.js
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@EchoZhaoH
EchoZhaoH / hear-dom.js
Created August 13, 2021 09:45 — forked from zerobias/hear-dom.js
Hear DOM changes with WebAudio API
/*
Copy this into the console of any web page that is interactive and doesn't
do hard reloads. You will hear your DOM changes as different pitches of
audio.
I have found this interesting for debugging, but also fun to hear web pages
render like UIs do in movies.
*/
const audioCtx = new (window.AudioContext || window.webkitAudioContext)()
const observer = new MutationObserver(function(mutationsList) {