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 { execSync } from 'node:child_process' | |
import fs from 'node:fs' | |
import path from 'node:path' | |
import { defineConfig } from 'drizzle-kit' | |
const dbName = 'orbitkit-lite-start' | |
/** | |
* Workaround to make drizzle-kit work with local Cloudflare D1 databases. |
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
model: claude-opus-4-20250514 | |
messages: | |
- role: user | |
content: | |
- type: text | |
text: | | |
<system-reminder> | |
As you answer the user's questions, you can use the following context: | |
# important-instruction-reminders | |
Do what has been asked; nothing more, nothing less. |
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 CustomFulfillmentService from "./service" | |
import { | |
ModuleProvider, | |
Modules | |
} from "@medusajs/framework/utils" | |
export default ModuleProvider(Modules.FULFILLMENT, { | |
services: [CustomFulfillmentService], | |
}) |
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 redis | |
from collections import defaultdict | |
import json | |
from datetime import datetime, timedelta | |
import random | |
import time | |
def analyze_redis_memory(host='localhost', port=6379, db=1, pattern='*', sample_size=1000): | |
""" | |
Analyzes Redis keys and sorts them by memory usage. |
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 { getRedisCache } from './redis'; | |
export function cacheable<T extends (...args: any) => any>( | |
fn: T, | |
expireInSec: number | |
) { | |
const cachePrefix = `cachable:${fn.name}`; | |
function stringify(obj: unknown): string { | |
if (obj === null) return 'null'; | |
if (obj === undefined) return 'undefined'; |
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 type { ColumnDef } from "@tanstack/react-table"; | |
export interface Schema { | |
region: string; | |
trend: string; | |
p50: number; | |
} |
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 { registerOverriddenValidators } from '@medusajs/medusa' | |
import { type Constructor } from '@medusajs/types' | |
type DecoratorFunction = MethodDecorator | PropertyDecorator | |
type ExtensionDefinition = { | |
[key: string]: DecoratorFunction | DecoratorFunction[] | |
} | |
function extendValidator<Base extends Constructor<any>>( |
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 Anthropic from "@anthropic-ai/sdk"; | |
import type { MessageParam } from "@anthropic-ai/sdk/resources"; | |
import dotenv from "dotenv"; | |
import { Instructor } from "./instructor"; | |
import type { z } from "zod"; | |
dotenv.config(); | |
function sendToClaude<T>(message: MessageParam, schema: z.Schema<T>) { | |
const anthropicClient = new Anthropic({ |
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 redis from '@/lib/redis' | |
import { tap } from '@/lib/utils' | |
import { NextResponse } from 'next/server' | |
import { NowPlaying } from '@/types/activities' | |
import { base64_encode, use } from '@/lib/utils' | |
type SpotifyResponse = { | |
is_playing: boolean | |
progress_ms: number | |
item: { |
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 {SanityClient} from '@sanity/client' | |
import {v5 as uuidv5} from 'uuid' | |
import {buildCollectionDocumentId, commitCollectionDocument} from './sanityOps' | |
import type {ShopifyDocumentCollection} from './storageTypes' | |
import {SHOPIFY_COLLECTION_DOCUMENT_TYPE, UUID_NAMESPACE_COLLECTIONS} from './constants' | |
import {DataSinkCollection} from './requestTypes' | |
import {idFromGid} from './requestHelpers' |
NewerOlder