Search
copperMammal
@jamisonl
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
HTTP
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
req.headers.get("X-Signature-Ed25519"),
req.headers.get("X-Signature-Timestamp"),
// Get the user calling this slash command
const userId = await body.member?.user?.id;
if (bank[userId] === undefined) bank[userId] = starting_amount;
web_uecrPCN6rT
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_uecrPCN6rT(req) {
return new Response(`<!DOCTYPE html>
<html>
val_E5UJ0Jjo8u
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
twEndpoint
@syncretizm
An interactive, runnable TypeScript val by syncretizm
HTTP
import { PuppeteerDeno } from "https://deno.land/x/puppeteer@16.2.0/src/deno/Puppeteer.ts";
import process from "node:process";
export async function extractTwitterContent(req) {
try {
console.log("Starting to extract Twitter content...");
chocolateMeerkat_public
@wannli
An interactive, runnable TypeScript val by wannli
Script
export async function chocolateMeerkat(req) {
const body = await req.json();
namesToLinks[match[1].toLowerCase()] = match[2]; // Store lowercased names for case-insensitive matching
// Function to escape special characters in a string for regex
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
// Function to dynamically generate the replacement string based on original casing
function replaceNameWithLink(match) {
const link = namesToLinks[match.toLowerCase()];
FetchBasic
@charmaine
Framer Fetch: Basic A basic example of an API endpoint to use with Framer Fetch.
HTTP
export default async function(req: Request): Promise<Response> {
// Pick a random greeting
const greetings = ["Hello!", "Welcome!", "Hi!", "Heya!", "Hoi!"];
Time_Blindness_Loud_Calendar_via_iOS_shortcuts
@willthereader
@jsxImportSource https://esm.sh/hono@latest/jsx
HTTP
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
import { Context, Hono } from "npm:hono";
// Define the route handler function
export const Time_Blindness_Loud_Calendar_via_iOS_shortcuts = (c: Context) => {
console.log("Route accessed: Time_Blindness_Loud_Calendar_via_iOS_shortcuts");
myApi
@raymondcamden
An interactive, runnable TypeScript val by raymondcamden
Script
export function myApi(name, color = "blue") {
return `Hello ${name}, your favorite color is ${color}.`;
fetchEvents
@richardwu9
An interactive, runnable TypeScript val by richardwu9
Script
export default async function(req: Request): Promise<Response> {
// Setup CORS Headers
const headers = new Headers();
![vawogbemi avatar](https://images.clerk.dev/oauth_github/img_2TXrDk0iTsMgo2T7z93Wn4eqcgK.jpeg)
whoIsHiringAbout
@vawogbemi
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
export default function About() {
const linkClass = "text-sky-600 hover:text-sky-500";
return (
![spoon avatar](https://images.clerk.dev/uploaded/img_2QtQTiqE9H61aUXYNZMUhyxWO61.jpeg)
myApi
@spoon
An interactive, runnable TypeScript val by spoon
Script
export function myApi(name) {
return "hi " + name;
myApi
@garcila
An interactive, runnable TypeScript val by garcila
Script
export function myApi(name) {
return "hi " + name;
graciousAmaranthMackerel
@imnk
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [image, setImage] = useState<File | null>(null);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
if (request.method === 'POST' && new URL(request.url).pathname === '/analyze') {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
try {
String.fromCharCode(...new Uint8Array(imageBytes))
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",