Search

Results include substring matches and semantically similar vals. Learn more
jamisonl avatar
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
mmands, 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;
dhvanil avatar
web_uecrPCN6rT
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_uecrPCN6rT(req) {
return new Response(`<!DOCTYPE html>
<html>
dhvanil avatar
val_E5UJ0Jjo8u
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
syncretizm avatar
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...");
wannli avatar
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()];
charmaine avatar
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!"];
willthereader avatar
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");
raymondcamden avatar
myApi
@raymondcamden
An interactive, runnable TypeScript val by raymondcamden
Script
export function myApi(name, color = "blue") {
return `Hello ${name}, your favorite color is ${color}.`;
richardwu9 avatar
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
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
myApi
@spoon
An interactive, runnable TypeScript val by spoon
Script
export function myApi(name) {
return "hi " + name;
garcila avatar
myApi
@garcila
An interactive, runnable TypeScript val by garcila
Script
export function myApi(name) {
return "hi " + name;
imnk avatar
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",
ugochionyejiaka avatar
scientificSalmonBonobo
@ugochionyejiaka
// Fetches a random joke.
Script
// ... imports ...
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
zhangbao avatar
hello
@zhangbao
An interactive, runnable TypeScript val by zhangbao
Script
export function hello(name) {
return "hi " + name;