Skip to content

Instantly share code, notes, and snippets.

@thebiltheory
thebiltheory / ChoasLinesShader.metal
Created January 8, 2024 13:55 — forked from realvjy/ChoasLinesShader.metal
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@thebiltheory
thebiltheory / generate-icon-list.ts
Last active February 27, 2024 03:53
Generate an array of items from the content of a folder
const fs = require("fs");
const path = require("path");
const nodeUtils = require("../utils/node.utils");
const directoryPath: string = path.join(__dirname, "../assets/icons");
fs.readdir(
directoryPath,
(err: NodeJS.ErrnoException | null, files: string[]) => {
if (err) {
@thebiltheory
thebiltheory / generate-payload-media.ts
Created March 1, 2024 04:25
Process payload medias
import sharp from "sharp";
import { Media } from "./collections/Media";
/**
* @see https://github.com/payloadcms/payload/discussions/1834
*/
export const regenerateMediaSizes = async ({ media, payload }) => {
try {
await Promise.all(
media.docs.map(async (mediaDoc) => {