Skip to content

Instantly share code, notes, and snippets.

View tpatel's full-sized avatar

Thibaut Patel tpatel

View GitHub Profile
docker stop $(docker ps -a -q)
function setup() {
createCanvas(500, 500);
background('#ffffff');
noLoop();
}
function randomLine(x, y, w, h) {
if(Math.random() < 0.5) {
line(x, y, x+w, y+h);
} else {
@tpatel
tpatel / faces.js
Created December 29, 2020 14:57
Draws many wobbly circles
const points = 16;
const maxNoise = 0.5;
const transparency = 0.05;
const lines = 1024;
const lineStepNoise = 0.001;
const minRadius = 10;
const maxRadius = 700;
@tpatel
tpatel / googly-eyes.js
Created January 22, 2022 22:03
p5.js implementation of googly eyes looking around (https://twitter.com/thibpat/status/1484628474002300928). Paste into https://editor.p5js.org/ to try it out!
let colors;
const colorOptions = ['green', 'darkblue', '#954535', 'black'];
function setup() {
createCanvas(400, 400);
colors = Array(10).fill(0).map(x => colorOptions[floor(random(0, colorOptions.length))]);
}
function eye(x, y, targetX, targetY, color) {
noFill();
stroke(0);
@tpatel
tpatel / [slug].js
Created November 3, 2022 14:03
Example of GenerateBanners.com <=> Next.js integration for custom open graph images
import Head from "next/head";
import GenerateBanners from "@generatebanners/node-sdk";
const client = new GenerateBanners({
apiKey: process.env.GB_API_KEY,
apiSecret: process.env.GB_API_SECRET,
});
export default function Post({ post, image }) {
return (
// A person that can login to the SaaS
model User {
id String @id @unique @default(cuid())
name String?
email String?
Member Member[]
}
// A workspace of several persons, focused on one podcast
model Podcast {