Skip to content

Instantly share code, notes, and snippets.

View DriesDD's full-sized avatar

Dries De Decker DriesDD

View GitHub Profile
@lazamar
lazamar / loadPageSection.js
Last active April 12, 2022 21:53
Vanilla JS implementation of JQuery's .load
/**
* Loads an HTML document from a URL and retuns an element selected using
* the 'selector' parameter
* Example usage:
* loadPageSection('./myPage.html', '#container', (r, err) => console.log(r, err));
*
* @method loadPageSection
* @param {String} url
* @param {String} selector - A valid CSS selector
* @param {Function} callback - To be called with two parameters (response, error)
// by dw @ bees & bombs >:)
int[][] result;
float t;
void setup() {
setup_();
result = new int[width*height][3];
}