Skip to content

Instantly share code, notes, and snippets.

@GoToLoop
GoToLoop / NoRepeatIdInput.pde
Last active August 6, 2021 20:25
JavasScript's alert(), confirm(), prompt(), isNaN(), isFinite() and some few others as a Java class!
/**
* No Repeat ID Input (v2.1.1)
* by GoToLoop (2015/Sep/15)
*
* Forum.Processing.org/two/discussion/12532/
* windowjs-cross-mode-alert-confirm-prompt-other-js-api-for-java#Item_2
*
* Forum.Processing.org/two/discussion/869/check-array-contents-with-arraylist
*
* Studio.ProcessingTogether.com/sp/pad/export/ro.9$Bjf6i21oXBw
@GoToLoop
GoToLoop / PVector.js
Last active February 13, 2023 05:21
PVector Class Refactoring for PJS
//module.exports = function(options, undef) {
"use strict";
const TAU = 2 * Math.PI,
lerp = (start, stop, amt = 0) => +start + amt*(stop - start),
sq = n => n*n,
pjsCheck = obj => obj != null && 'noLoop' in obj,
argsErr = (mtd, len, min) => {
throw `Too few args passed to ${mtd}() [${len} < ${min}].`;
};