Skip to content

Instantly share code, notes, and snippets.

@mattdesl
mattdesl / about.md
Last active October 16, 2018 11:57
regl + canvas sketch + hot reloading

canvas-sketch + regl + hot reloading

To quick start:

# move to an empty folder
mkdir my-folder && cd my-folder

# paste regl.js file
pbpaste > regl.js
@getify
getify / 1.js
Last active March 19, 2023 08:32
tag function for formatting console.log(..) statements
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
continue;
}
@mattdesl
mattdesl / README.md
Last active July 22, 2019 06:31
wasm + budo/browserify
/* This can be the start of a module */
const makeHandler = cb => {
return {
get (object, prop, receiver) {
if (Reflect.has(object, prop)) {
return Reflect.get(...arguments)
}
return new Proxy(() => {}, {
@mattdesl
mattdesl / about.md
Last active February 22, 2024 06:39
Parse & render SVG with penplot

parse & render SVG file with penplot

This might be handy if you have an SVG file that you want to use as, say, a mask for a generative algorithm.

Place the SVG file in the same directory that you are running penplot from.

test

function getUpdates() {
updateCell("B3", "ripple")
updateCell("C3", "bitcoin")
updateCell("D3", "ethereum")
updateCell("E4", "litecoin")
updateCell("F4", "iota")
}
function updateCell(cell, code) {
const response = UrlFetchApp.fetch("https://api.coinmarketcap.com/v1/ticker/" + code + "/?convert=EUR")
@mattdesl
mattdesl / addBarycentricCoordinates.js
Created August 16, 2017 01:59
unindex + add barycentric coordinates
import buffer from 'three-buffer-vertex-data';
export default function addBarycentricCoordinates (bufferGeometry) {
const barycentric = [];
const attrib = bufferGeometry.getIndex() || bufferGeometry.getAttribute('position');
const count = attrib.count / 3;
if (count % 2 !== 0) {
// Probably won't ever happen
console.error('WARN: Got a weird decimal result for attribute count, skipping wireframe...');
return;
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 13, 2025 15:15
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@Chandler
Chandler / slack_history.py
Last active March 27, 2025 01:16
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@paniq
paniq / ecs.md
Last active March 28, 2025 05:25
Entity Component Systems