Search

Results include substring matches and semantically similar vals. Learn more
richardwu9 avatar
terrificCoralMole
@richardwu9
An interactive, runnable TypeScript val by richardwu9
Script
export async function fetchEvents() {
const url = "https://api.lu.ma/public/v1/calendar/list-events";
const headers = {
dhvanil avatar
val_2ndWr7OczV
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_2ndWr7OczV(req) {
try {
// Execute the code directly and capture its result
rmkubik avatar
myApi
@rmkubik
An interactive, runnable TypeScript val by rmkubik
Script
export function myApi(name) {
return "hi " + name;
romanewmedia avatar
api
@romanewmedia
An interactive, runnable TypeScript val by romanewmedia
HTTP
export default async function(req: Request): Promise<Response> {
// Setup CORS Headers
const headers = new Headers();
fks avatar
myApi
@fks
An interactive, runnable TypeScript val by fks
Script
export function myApi(name) {
return "hi " + name;
jeffreyyoung avatar
poebot
@jeffreyyoung
a simple poe bot
HTTP
// protocol https://creator.poe.com/docs/poe-protocol-specification
async function getResponse(req: any, send: (event: string, data?: any) => void) {
send("meta", { content_type: "text/markdown" });
send("done");
function encodeEvent(event: string, data?: any = {}) {
return new TextEncoder().encode(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
export default async function(req: Request): Promise<Response> {
let timerId: number | undefined;
tesla6940 avatar
aiMessenger
@tesla6940
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
function generateSecureRoomCode() {
return crypto.randomUUID().split("-")[0].toUpperCase();
function App() {
const [user, setUser] = useState(null);
useEffect(() => {
async function fetchUser() {
try {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const { OpenAI } = await import("https://esm.town/v/std/openai");
const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
const openai = new OpenAI();
const SCHEMA_VERSION = 5;
// Generate AI response
const aiCompletion = await openai.chat.completions.create({
messages: [{
levi avatar
twitterRAG
@levi
NOTE: We've disabled the Exa API key in this demo due to high volume – you'll need to fork and provide your own to use it. Search on Twitter (powered by Exa ) and return a streaming markdown summary (powered by Substrate ). To fork, sign up for Substrate to get your own API key and $51 free credits. You'll also need Exa, which comes with generous free credits and can be a much cheaper alternative to the Twitter API.
HTTP
const stream = await substrate.stream(markdown);
// Render streaming markdown
export default async function handler(req: Request): Promise<Response> {
const renderMarkdown = (await import("https://esm.town/v/substrate/renderMarkdown")).default;
return renderMarkdown(stream);
jakesing avatar
myApi
@jakesing
An interactive, runnable TypeScript val by jakesing
Script
import { myName } from "https://esm.town/v/jakesing/myName";
export function myApi() {
return "hi " + myName;
hedy avatar
myApi
@hedy
An interactive, runnable TypeScript val by hedy
Cron
export function myApi(name) {
return "hi " + name;
stevekrouse avatar
Time_Blindness_Loud_Calendar_via_iOS_shortcuts
@stevekrouse
@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");
dhvanil avatar
val_6WXnVNyeHQ
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_6WXnVNyeHQ(req) {
try {
// Execute the code directly and capture its result
stevekrouse avatar
runOnPageLoad
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export function runOnPageLoad(name) {
console.email("page loaded!");
return `hi ${name} from val town!`;
boozedog avatar
myApi
@boozedog
An interactive, runnable TypeScript val by boozedog
Script
export function myApi(name) {
return "hi " + name;
janpaul123 avatar
valle_tmp_92279164241240222981465199368394
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
const targetWord = 'CRAZY';
let attempts = 0;
function submitWord() {
const input = document.getElementById('word-input').value.toUpperCase();
if (input.length !== 5) {