Skip to content

Instantly share code, notes, and snippets.

View ippsketch's full-sized avatar

Jeff ippsketch

View GitHub Profile
@ippsketch
ippsketch / imageGrid.js
Last active August 16, 2022 13:50
p5.js script to generate collage of a fxhash project (using pre-downloaded images)
// use this to get download the images https://github.com/cables-and-pixels/pyfxhash
projectNumber = 17759; //fxhash project number
numberOfMints = 97; // number of mints for this project
gridSizeX = 10; // x-dimension grid size for the output collage
gridSizeY = Math.ceil(numberOfMints/gridSizeX);
aspectRatio = 3/4; //of the individual images (width/height)
let w = 2048*2; // width of output image
let h = w*gridSizeY/(gridSizeX*aspectRatio);
let dx = w/gridSizeX;
@ippsketch
ippsketch / gridPack.js
Created September 1, 2021 03:13
Grid pack
let gridFlag = []; //array of underlying grid flags (true==filled)
let shapes = []; //array of shape objects
let dx,dy; // grid spacing
function setup() {
createCanvas(1000,1000);
iNum = 20;
jNum = 20;
dx = width/iNum;;
dy = height/jNum;
for i in *.gif;
do name=`echo "$i" | cut -d'.' -f1`
tmp = ${name:0:5}
echo "$tmp"
ffmpeg -i "$i" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${name}.mp4"
done
@ippsketch
ippsketch / pixel-deck-blue-back.md
Last active May 4, 2021 14:09
Pixel Deck: Blue Back
var cap = true; // change this to create a gif and change stop condition
var start = false;
if (cap){var capturer = new CCapture( { format: 'png' } );}
var i = 0; //initiate
var PERIOD = 100;
// float t,i,p,a;
let t=1;
@ippsketch
ippsketch / gps-routes-in-p5js.md
Last active April 30, 2021 20:46
GPS routes in p5js

The two files you need to sketch GPS routes with p5.js are below

More information can be found here: https://ippsketch.com/posts/gps-running-routes-with-p5js/

To make this work, you need to:

  1. Copy these files to a directly
  2. Make a subfolder called js and place p5.min.js into it. You can download that here: https://p5js.org/download/
  3. Put ccapture.all.min.js into that js subfolder as well if you want to record png files. That can be found here: https://github.com/spite/ccapture.js/
  4. Place your GPS files into the directory
  5. Put the filenames into the sketchGPSroutes.js file (see line 15 of that file for notes)