Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniell daniellwdb

View GitHub Profile
@daniellwdb
daniellwdb / config.yaml
Created May 11, 2022 07:31
beets config
View config.yaml
# Beets config
# Album art manually saved to music folders from: https://covers.musichoarders.xyz
directory: R:/media/music
library: ~/iCloudDrive/beets/library.db
plugins:
## Autotagger Extensions
# https://beets.readthedocs.io/en/stable/plugins/discogs.html
- discogs
@daniellwdb
daniellwdb / strategy.ts
Created December 5, 2021 09:27
fastify-passport custom strategy
View strategy.ts
type RequestBody = {
email?: string
code?: string
}
type SMSStrategyRequest = FastifyRequest<{ Body: RequestBody }>
class SMSStrategy extends Strategy {
private readonly prisma: PrismaClient
@daniellwdb
daniellwdb / cacheMiddleware.ts
Last active June 14, 2022 17:25
Prisma cache middleware
View cacheMiddleware.ts
import type { Prisma } from "@prisma/client"
import { redis } from "../redis"
type CacheMiddlewareOptions = {
model: Prisma.ModelName
action: Prisma.PrismaAction
keys?: string[]
defaultValues?: Record<string, unknown>
ttlInSeconds: number
}