Skip to content

Instantly share code, notes, and snippets.

@GoToLoop
GoToLoop / HackedMovie.java
Last active October 21, 2022 11:49
Hacked Movie EoS Event
View HackedMovie.java
/**
* Hacked Movie EoS Event (v2.1.0)
* by GoToLoop (2022-Oct-20)
*
* Gist.GitHub.com/GoToLoop/67023ba3e9ba1d0301c40f7c030d176a
*
* Discourse.Processing.org/t/hacked-movie-eos-event-library/39375
* Forum.Processing.org/two/discussion/14990/movie-begin-and-end-events#Item_1
*/
@GoToLoop
GoToLoop / ArrayList_Shims.js
Last active November 6, 2020 03:49
ArrayList Polyfill Shims for JS Arrays
View ArrayList_Shims.js
// ArrayList Polyfill Shims for JS Arrays (v1.0.1)
// GoToLoop (2020/Nov/05)
// https://Gist.GitHub.com/GoToLoop/a74c5780667f2610097cfc007e53a559
"use strict";
// Add some useful Java list's methods to JS arrays as polyfills:
Object.defineProperties(Array.prototype, {
size: {
value() { // polyfill hack to add method size() to JS arrays
@GoToLoop
GoToLoop / MatrixFrameGL.py
Last active August 24, 2020 09:21
Push/Pop Limit Workaround (Python Mode)
View MatrixFrameGL.py
"""
* Push/Pop Limit Workaround (v1.0.5)
* GoToLoop (2020/Aug/22)
*
* Discourse.Processing.org/t/too-many-calls-to-pushmatrix/23411/9
* Gist.GitHub.com/GoToLoop/193d951ef13f212f09e2b2809efc4de0
"""
from processing.opengl import PGraphicsOpenGL
@GoToLoop
GoToLoop / MatrixFrameGL.java
Last active August 23, 2020 02:16
Push/Pop Limit Workaround (Java Mode)
View MatrixFrameGL.java
/**
* Push/Pop Limit Workaround (v1.0.1)
* GoToLoop (2020/Aug/22)
*
* Discourse.Processing.org/t/too-many-calls-to-pushmatrix/23411/8
* Gist.GitHub.com/GoToLoop/e35ac69e9bd4dbbcce557218c3b20588
*/
// Comment out the package statement below if it's inside a ".java" file:
package processing.core;
@GoToLoop
GoToLoop / .block
Last active January 29, 2021 09:10
Get p5js Version
View .block
height: 200
scrolling: no
border: no
license: cc-by-4.0
@GoToLoop
GoToLoop / .block
Last active August 10, 2020 03:44
Brownian Motion
View .block
height: 610
scrolling: no
border: no
license: cc-by-4.0
@GoToLoop
GoToLoop / .block
Last active August 10, 2020 03:43
Trailing Deque
View .block
height: 600
scrolling: no
border: no
license: cc-by-4.0
@GoToLoop
GoToLoop / .block
Last active August 28, 2019 20:17
Ramer–Douglas–Peucker Algorithm
View .block
height: 600
scrolling: no
border: yes
license: cc-by-4.0
View windowResized.global.js
function windowResized() {
const css = getComputedStyle(canvas.parentElement),
mw = float(css.marginLeft) + float(css.marginRight),
mh = float(css.marginTop) + float(css.marginBottom),
ww = float(css.width) || windowWidth,
wh = float(css.height) || windowHeight,
w = round(ww - mw), h = round(wh - mh);
resizeCanvas(w, h, true);
}
@GoToLoop
GoToLoop / CanvasResizeWatcher.java
Last active March 26, 2019 17:57
Canvas Resize Watcher
View CanvasResizeWatcher.java
/**
* Canvas Resize Watcher (v1.0)
* GoToLoop (2018/May/04)
* Developed on P3 (v3.3.5)
*
* https://Discourse.Processing.org/t/event-called-when-canvas-is-resized/6643/8
* https://Gist.GitHub.com/GoToLoop/1d1eb18f468a7d5758469707276b6ea1
*/
package gotoloop.listener;