Skip to content

Instantly share code, notes, and snippets.

View ItsWendell's full-sized avatar

Wendell Misiedjan ItsWendell

View GitHub Profile
@Ventanas95Dev
Ventanas95Dev / StoryblokPreviewSyncer
Last active October 6, 2024 10:43
Next.js (app router) React server components and Storyblok Preview "real time update" 🎉
'use client'
import { useEffect, useTransition } from 'react'
import { registerStoryblokBridge } from './registerStoryblokBridge'
import { previewUpdateAction } from '../../app/actions/previewUpdateAction'
export const StoryblokPreviewSyncer = ({ storyId, pathToRevalidate }) => {
let [isPending, startTransition] = useTransition()
useEffect(() => {
const id = storyId
@zxt-tzx
zxt-tzx / explain.ts
Last active May 7, 2025 11:55
Drizzle helper functions: explain
import type { SQLWrapper } from "drizzle-orm";
import { sql } from "drizzle-orm";
import type { DbClient } from "@/db";
export const explainAnalyze = async <T extends SQLWrapper>(
db: DbClient,
query: T,
) => {
const debugResult = await db.execute(sql`EXPLAIN ANALYZE ${query.getSQL()}`);