| title | Understand Dynamic MDX with Supabase | |||||
|---|---|---|---|---|---|---|
| description | Learn how to fetch, parse, and render dynamic MDX content from Supabase using Next.js and next-mdx-remote. | |||||
| date | 2025-06-03 | |||||
| tags |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Image from "next/image"; | |
| import type { MDXImageType } from "@/utils/types"; | |
| // MDXImage custom component | |
| // Utilizes the built-in Next.js Image component as well as the figcaption element | |
| export default function MDXImage(imageProperties: MDXImageType): React.JSX.Element { | |
| return ( | |
| <figure className='text-center my-6'> | |
| <div className="relative inline-block p-4 bg-gray-900/30 rounded-lg border-2 border-green-500 shadow-[0_0_15px_rgba(34,197,94,0.3)] transition-all duration-300 hover:shadow-[0_0_25px_rgba(34,197,94,0.5)] hover:scale-[1.02]"> | |
| <Image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type GitHubGistType from '@/utils/types/GitHubGistType'; | |
| import GistCopyButton from './GistCopyButton'; | |
| import GistCodeBlock from './GistCodeBlock'; | |
| import { GITHUB_USERNAME, GITHUB_GIST_LANGUAGE_MAP, GIST_BASE_URL } from '@/utils/constants'; | |
| export default async function GitHubGist({ id, figCaptionText }: GitHubGistType): Promise<React.JSX.Element> { | |
| try { | |
| const headers: HeadersInit = { | |
| 'Accept': 'application/vnd.github.v3+json', | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use client"; | |
| import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; | |
| import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism'; | |
| import { toast } from 'sonner'; | |
| // Custom code block component for handling code in MDX files | |
| // Visual Studio Code Dark Plus theme with copy functionality | |
| const CodeBlock = ({ className = '', children }: { className?: string; children: string }): React.JSX.Element => { | |
| const match = /language-(\w+)/.exec(className || ''); | |
| const language = match?.[1] || 'text'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Daily Crypto Market Update Email", | |
| "nodes": [ | |
| { | |
| "parameters": { | |
| "rule": { | |
| "interval": [ | |
| { | |
| "triggerAtHour": 8 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Daily Crypto Market Update Email", | |
| "nodes": [ | |
| { | |
| "parameters": { | |
| "rule": { | |
| "interval": [ | |
| { | |
| "triggerAtHour": 8 | |
| } |
This project uses RTK (Rust Token Killer) to reduce LLM context token usage by filtering, compacting, and summarizing noisy terminal output before it reaches Claude Code.
- Prefer RTK-wrapped commands whenever possible.
- If an RTK equivalent exists, use it instead of the raw command.
- Avoid excessive terminal output that wastes context tokens.
- Prefer focused inspection over dumping entire logs, diffs, or recursive directory trees.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const path = require('path'); | |
| require('dotenv').config({ path: path.resolve(__dirname, '..', '.env') }); | |
| // Eleven Labs for TTS generation from Text files | |
| const ELEVENLABS_API_KEY = process.env.ELEVENLABS_API_KEY; | |
| const VOICE_ID = 'pNInz6obpgDQGcFmaJgB'; // Adam — professional male | |
| const MODEL_ID = 'eleven_turbo_v2_5'; // Best cost-to-quality ratio | |
| const MAX_CHARS = 4500; // ElevenLabs safe limit per request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| curl https://your-chutes-username-your-model-name.chutes.ai/v1/chat/completions \ | |
| -H "Authorization: Bearer YOUR_CHUTES_API_KEY" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "model": "your-hf-username/your-finetuned-model", | |
| "messages": [ | |
| { | |
| "role": "user", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from chutes.chute import NodeSelector | |
| from chutes.chute.template.vllm import build_vllm_chute | |
| chute = build_vllm_chute( | |
| username="your-chutes-username", | |
| # Replace this with YOUR fine-tuned Hugging Face model | |
| model_name="your-hf-username/your-finetuned-model", | |
| node_selector=NodeSelector( |
NewerOlder