Skip to content

Instantly share code, notes, and snippets.

View DrMint's full-sized avatar

DrMint

View GitHub Profile
@DrMint
DrMint / exampleBlocks.ts
Last active January 29, 2024 04:25
Generating finite tree-like block structures for Payload CMS
import { BlocksConfig, generateBlocks } from "./recursiveBlocks";
// First, we define all your blocks name
const enum BlockName {
Text = "Text",
Section = "Section",
}
// Then, the configuration.
const blocksConfig: BlocksConfig<BlockName> = {
@DrMint
DrMint / ExampleCollection.ts
Last active October 25, 2024 10:59
Grid View for Payload Uploads Collections
import { CollectionConfig } from "payload/types";
import { UploadsGridView } from "../../components/UploadsGridView/UploadsGridView";
export const Media: CollectionConfig = {
slug: "media",
admin: {
components: { views: { List: UploadsGridView } } // Set the List view to use the Grid view,
},
upload: {
staticURL: "/media",
@DrMint
DrMint / dots.css
Last active November 20, 2022 15:23
5-step gradient dithering between two given colors in CSS
:root {
--dot-color-1: black;
--dot-color-2: white;
--bg-dot-0: var(--dot-color-2);
--bg-dot-25: conic-gradient(var(--dot-color-1) 25%, var(--dot-color-2) 25%) repeat center / 2px
2px;