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 "jsr:@supabase/functions-js/edge-runtime.d.ts"; | |
import Stripe from "npm:stripe"; | |
import { createClient } from "jsr:@supabase/supabase-js@2"; | |
import headers from "../_shared/headers.ts"; | |
import type { Database } from "../_shared/database.types.ts"; | |
type CheckoutRequest = { | |
price?: string; | |
}; |
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
-- OBS Timestamp Marker Script | |
-- Allows marking timestamps during recording and saves them to a CSV file | |
-- Set a hotkey to mark moments in your recording that you can review later | |
obs = obslua | |
local marks = {} | |
local recording_start_time = 0 | |
local settings_hotkey = "" | |
local settings_directory = "" |
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": "Get Notion Page as Markdown", | |
"nodes": [ | |
{ | |
"parameters": { | |
"workflowInputs": { | |
"values": [ | |
{ | |
"name": "id" | |
} |
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
/* Helper function to extract plain text from a rich_text array */ | |
function parseRichText(richTextArray) { | |
if (!richTextArray || !Array.isArray(richTextArray)) return ""; | |
return richTextArray.map(rt => rt.plain_text).join(""); | |
} | |
/* Recursively convert a list of notion blocks into a Markdown string */ | |
function convertNotionBlocksToMarkdown(blocks, indentLevel = 0) { | |
const indent = " ".repeat(indentLevel); // two spaces per indent level | |
let md = ""; |
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 of the Docker container | |
CONTAINER_NAME="avalanche-node" | |
# Directory for persistent data | |
DATA_DIR="$(pwd)/avalanche" | |
# AvalancheGo Docker image | |
IMAGE="avaplatform/avalanchego:latest" | |
# Mainnet network ID |
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
function getRandomElement(arr) { | |
if (!Array.isArray(arr) || arr.length === 0) { | |
throw new Error('The input must be a non-empty array.'); | |
} | |
const randomIndex = Math.floor(Math.random() * arr.length); | |
return arr[randomIndex]; | |
} | |
const items = $input.all(); |
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 typing import Any, List, Mapping, Optional | |
# pip install httpx langchain | |
import httpx | |
from langchain.callbacks.manager import CallbackManagerForLLMRun | |
from langchain_core.language_models.llms import LLM | |
class LlamaCppServer(LLM): | |
'''Use Llama.cpp's builtin server to remotely host an LLM for use with Langchain''' |
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 pathlib import Path | |
from modal import Image, Mount, Stub, asgi_app, gpu, method | |
from pydantic import BaseModel | |
def download_models(): | |
from huggingface_hub import snapshot_download | |
ignore = ["*.bin", "*.onnx_data", "*/diffusion_pytorch_model.safetensors"] |
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 | |
# This script squashes a git repo into a single commit with a specified commit message | |
# Check if git is installed | |
if ! git --version 1>/dev/null 2>&1; then | |
echo "Error: git is not installed. Please install git and try again." | |
exit 1 | |
fi |
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
// LICENSE: https://chand1012.mit-license.org | |
const fetchWithTimeout = (url: string, options: RequestInit, timeout: number = 10000): Promise<any> => { | |
return new Promise(async (resolve, reject) => { | |
const controller = new AbortController(); | |
const signal = controller.signal; | |
const timer = setTimeout(() => { | |
controller.abort(); | |
reject(new Error("Request timed out")); | |
}, timeout); |
NewerOlder