Skip to content

Instantly share code, notes, and snippets.

@shiffman
shiffman / p5-github-tutorial.md
Last active March 30, 2024 05:02
Guide for pushing p5.js sketch to GitHub

Guide for pushing p5.js sketch folder to a new GitHub repo

If you have never used git before on your computer!

$ git config --global user.name username
$ git config --global user.email email@email.com

Commands once you create a empty repo ("skip this step") on GitHub

@shiffman
shiffman / sketch.js
Created May 18, 2023 15:53
Gist from VSCode Stream
let stars = [];
let factor = 100;
let speedSlider;
function setup() {
createCanvas(windowWidth, windowHeight);
speedSlider = createSlider(0, 20, 2, 0.1);
for (let i = 0; i < 500; i++) {
stars[i] = createVector(
random(-width*factor,width*factor),
@shiffman
shiffman / coding-train-2023.md
Last active February 19, 2024 23:35 — forked from dipamsen/coding-train-2023.md
Coding Train 2023 Goals and Plans

Coding Train 2023 Goals and Plans

  • Challenges: (Goal: 10 challenges)
    • Soft Body Physics Challenge (toxiclibs)
    • Pi Day - Buffon's Needle
    • The Climate Spiral
    • ⭐ Wolfram Elementary CA
    • Wave Function Collapse Overlapping model
    • 'Signed Distance Functions'
  • Secord's Algorithm (Dithering/Voronoi Stippling); info
@shiffman
shiffman / cube3D.a
Last active August 29, 2023 15:57
AppleSoft BASIC 3D Cube
10 REM POKE 230,32 : REM page 1
20 REM POKE 230,64 : REM page 2
30 REM POKE 49236,0 : REM display page 1
40 REM POKE 49237,0 : REM display page 2
100 HGR:HGR2
105 W = 140 : H = 90 : SL = 50
110 TH = 0
120 SCR = 0
125 GOSUB 1000
@shiffman
shiffman / sketch1.js
Created September 15, 2015 20:02
10PRINT in p5.js
// 10print.org
// Animated version of 10 print.
var x = 0;
var y = 0;
function setup() {
createCanvas(640, 360);
background(255);
}
@shiffman
shiffman / sketch.js
Created April 29, 2022 19:39
Picked via random.org
function setup() {
createCanvas(400, 400);
const url = 'https://www.random.org/integers/?num=10&min=2&max=1316&col=1&base=10&format=plain&rnd=new';
loadStrings(url, gotData);
function gotData(data) {
console.log(data);
}
}
@shiffman
shiffman / flip.pde
Created October 25, 2015 00:48
Flipping Video in Processing
import processing.video.*;
Capture cam;
void setup() {
size(640, 480);
cam = new Capture(this, 640, 480);
cam.start();
}
@shiffman
shiffman / wheel.txt
Last active March 4, 2022 18:12
Current list of wheel ideas
Falling Sand
K-d Tree
Fast Blur
Slime Mold
Spider Web
K-means
image stippling
Wave collapse function
Skyline Viz
Dancing Skeleton
@shiffman
shiffman / space_colonization.pde
Created May 27, 2016 16:36
Space Colonization Attempt
Tree tree;
float min_dist = 5;
float max_dist = 250;
void setup() {
size(180, 300);
tree = new Tree();
}
@shiffman
shiffman / sketch.js
Created October 31, 2020 19:26
Coding Challenge 80 update
function setup() {
noCanvas();
let button = createButton('start');
button.mousePressed(function() {
let speech = new p5.Speech();
let speechRec = new p5.SpeechRec('en-US', gotSpeech);
let continuous = true;
let interim = false;
speechRec.start(continuous, interim);