Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View daniellwdb's full-sized avatar

Daniell daniellwdb

View GitHub Profile
@daniellwdb
daniellwdb / strategy.ts
Created December 5, 2021 09:27
fastify-passport custom strategy
type RequestBody = {
email?: string
code?: string
}
type SMSStrategyRequest = FastifyRequest<{ Body: RequestBody }>
class SMSStrategy extends Strategy {
private readonly prisma: PrismaClient
@daniellwdb
daniellwdb / config.yaml
Created May 11, 2022 07:31
beets config
# 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 / cacheMiddleware.ts
Last active June 14, 2022 17:25
Prisma cache middleware
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
}