Skip to content

Instantly share code, notes, and snippets.

View rvillas's full-sized avatar

rvillas rvillas

View GitHub Profile
// Processing code by Etienne JACOB
// inspired by beesandbombs : https://twitter.com/beesandbombs/status/1563110024204787712
// motion blur template by beesandbombs
int[][] result;
float t, c;
// utils... most unused here
float c01(float x)
// by dave
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
// code updates are now there:
// https://github.com/Bleuje/processing-animations-code/blob/main/code/sierpinskiloop/sierpinskiloop.pde
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// See the license information at the end of this file.
// View the rendered result at: https://twitter.com/etiennejcb/status/1367173073250758661
int[][] result;
float t, c;
@beesandbombs
beesandbombs / shiftinSquares.pde
Created February 18, 2021 17:12
shiftin’ squares
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@beesandbombs
beesandbombs / cubes.pde
Created August 19, 2020 11:31
cube / cubes
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
<script>
import { Props, Color, Slider } from "txl";
export let positions = [];
export let cells = [];
export let strokeStyle = '#000000';
export let lineJoin = 'round';
export let lineCap = 'round';
export let lineWidth = 1;
const {
canvasSketch,
GUI,
KeyPress,
FaviconRenderer
} = require('./hooks');
const settings = {
animate: true,
scaleToView: true,
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@mattdesl
mattdesl / motion-blur.js
Last active January 2, 2022 12:05
canvas-sketch + motion blur + canvas2D (NOTE: Only blurs on sequence export) adapted from @delucis
// Adapted from @delucis
// https://github.com/delucis/pellicola/blob/735bd7487bdc597ac7272e4ddce9473c15f68d09/lib/frame-maker.js#L99-L134
const canvasSketch = require('canvas-sketch');
const settings = {
dimensions: [ 512, 512 ],
duration: 3,
animate: true,
fps: 24