Skip to content

Instantly share code, notes, and snippets.

View Greyvy's full-sized avatar
🤡
Living large

Grey Vaisius Greyvy

🤡
Living large
View GitHub Profile
@mattdesl
mattdesl / audio-example.js
Last active September 29, 2023 20:08
canvas-sketch + audio example https://microphone-circle.surge.sh/
const canvasSketch = require('canvas-sketch');
// A handy module to compute the average signal between two frequencies
// https://www.npmjs.com/package/analyser-frequency-average
const frequencyAverage = require('analyser-frequency-average');
const settings = {
// Animate the sketch
animate: true
};
@radgeRayden
radgeRayden / main.sc
Last active May 20, 2019 18:18
sokol triangle example in scopes
include
(import sokol)
""""#define SOKOL_NO_ENTRY
#define SOKOL_IMPL
#define SOKOL_GLCORE33
#include "include/sokol/sokol_app.h"
#include "include/sokol/sokol_gfx.h"
include
(import C)
@mattdesl
mattdesl / about.md
Last active May 10, 2025 11:01
interactive audio sketch
@munificent
munificent / generate.c
Last active July 4, 2025 13:39
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@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
@andrewrk
andrewrk / microsoft_craziness.h
Created September 1, 2018 14:35
jonathan blow's c++ code for finding msvc
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
varying vec4 vertColor;
varying vec3 vertNormal;
varying vec3 vertLightDir;
varying vec4 vertTexCoord;
@manoloide
manoloide / rectShadows.pde
Created January 9, 2018 07:48
Rect Shadows Particles
ArrayList<Rect> rects;
float mx, my, mm, time;
void setup() {
size(720, 720, P2D);
generate();
}
void draw() {
OpenSimplexNoise noise;
int numFrames = 100;
int margin = 50;
int m;
class Line{
float lr;
@bendc
bendc / simulate-typing.js
Created September 1, 2017 08:57
Fake typing animation
const trackTime = timing => {
const now = performance.now();
if (!timing.startTime) timing.startTime = now;
const elapsed = now - timing.startTime;
const {duration} = timing;
if (duration != null && duration <= elapsed) timing.startTime = null;
return elapsed;
};
const delay = (callback, duration) => {