Skip to content

Instantly share code, notes, and snippets.

View bingomanatee's full-sized avatar

Dave Edelhart bingomanatee

View GitHub Profile
@bingomanatee
bingomanatee / S.king.txt
Created April 8, 2024 00:39
Chat gpt does Stephen King
In the small, seemingly serene town of Derry, Maine, an ancient evil awakens, preying upon the town's children with a cycle that spans centuries. This time, however, something is different. A group of outcasts, known as "The Losers Club," find themselves inexplicably linked by their shared encounters with this malevolent force, manifesting as their deepest fears.The entity, which they come to know as "It," can transform into whatever terrifies them most, often taking the form of a sinister clown named Pennywise. The children discover that "It" is not just a creature, but the embodiment of the town's dark history and secrets. As they delve deeper, they realize that the adults of Derry are either oblivious to or complicit in the horror that unfolds every 27 years.Determined to end the cycle, The Losers Club embarks on a harrowing journey through the town's sewers, where "It" resides. Along the way, they confront their own traumas and fears, forging bonds that transcend their outcast status. The confrontation wi
import { v4 } from 'uuid'
export const sampleId = v4();
export const ID_PROP = {
type: 'string',
maxLength: sampleId.length,
};
export const INT = {
type: 'integer',
}
import { v4 } from 'uuid'
import { BehaviorSubject, switchMap } from 'rxjs'
import { ID_PROP, LINK_POINT, sampleId, STYLE } from '~/lib/utils/schemaUtils'
import { userManager } from '~/lib/managers/userManager'
export default function framesSchema(dataManager) {
return ({
plans: {
statics: {
newPlan(name, userId) {
"use client"
import { addRxPlugin, RxDatabase, RxDocument } from 'rxdb';
import { wrappedValidateZSchemaStorage } from 'rxdb/plugins/validate-z-schema';
import { RxDBDevModePlugin } from 'rxdb/plugins/dev-mode';
import { RxDBQueryBuilderPlugin } from 'rxdb/plugins/query-builder';
import { getRxStorageDexie } from 'rxdb/plugins/storage-dexie';
import { createRxDatabase } from 'rxdb';
import { RxDBMigrationPlugin } from 'rxdb/plugins/migration';
import { BehaviorSubject, combineLatest, map, Observable, Subscription } from 'rxjs'
import { Box2 } from 'three'
"use client"
import { useEffect, useMemo, useRef, useState } from 'react'
import { Forest } from '@wonderlandlabs/forest'
import { leafConfig, leafI } from '@wonderlandlabs/forest/lib/types'
import { useConst } from '@chakra-ui/hooks'
type configArray = [initializer: (...args: any) => leafConfig, ...rest: any];
export default function useForest<valueType>(
import { useEffect, useMemo, useState } from 'react'
import { Forest } from '@wonderlandlabs/forest'
import { leafConfig, leafI } from '@wonderlandlabs/forest/lib/types'
type configArray = [initializer: (...args: any) => leafConfig, ...rest: any];
export default function useForest<valueType>(
config: leafConfig | configArray,
onCreate?: (leaf: leafI) => unknown
)
@bingomanatee
bingomanatee / Memoization
Created January 31, 2023 20:03
a cheat sheet on memoization
Memoizing -- in general -- is essentially _caching_ -- preserving fixed answers to fixed input. This can
make computation faster by eliminating repeated processes that ultimately produce a known result for the same input.
This assumes "pure" functions, or in react, pure components.
Given that there is a certain overhead in translating html to JSX, caching the JSX for deterministic components saves
a significant amount of render time.
Similarly, react components only re-render when their arguments change. So, if an argument changes every time a
component
is encountered, the component will _always_ re-render. given that parameters are compared by reference, this
@bingomanatee
bingomanatee / NavCategory.ts
Created December 29, 2022 17:12
with manager class with manager class
/* eslint-disable @typescript-eslint/no-use-before-define,max-classes-per-file */
import { Navigation, SubNavigation } from 'shared/interfaces/navigation.interface'
export const DESKTOP_MODE = 'desktop'
export const MOBILE_MODE = 'mobile'
export const ROOT_ID = 'root'
interface named {
name: string
}
@bingomanatee
bingomanatee / grommet-theme.js
Created October 8, 2022 18:54
my grommet theme override
const baselineFontSizes = [
18, // text,
30, // l1,
24, // l2,
21, // l3,
18,
];
const sizeScales = new Map([
['small', 0.9],
import { forwardRef, Inject, Injectable } from '@nestjs/common';
import { BASE64, HEX, UTF8 } from '../../constants';
import { RedisService } from '../../redis/redis.service';
import { encodedData, encodedInfo } from '../../types';
const algorithm = 'aes-192-cbc';
@Injectable()
export class CryptoService {
constructor(