3import process from "node:process"
4
5export const tvshows = async function() {
6 const TV_SHOWS_WATCHED = [
7 // Ted Lasso
32 data.push(show)
33 }
34 data.sort(function(a, b) {
35 if (a.last_air_date > b.last_air_date)
36 return -1
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5"
2
3export async function getAppleDevice(req: Request) {
4 const deviceId = new URL(req.url).searchParams.get("search_keywords") as string
5 if (!deviceId) return Response.json("Please provide a search_keywords query parameter")
1export async function replaceEmojisWithImages(
2 req: express.Request,
3 res: express.Response,
54};
55
56function HiraganaWordBuilder() {
57 const [currentWord, setCurrentWord] = useState({ romaji: "", hiragana: "" });
58 const [userInput, setUserInput] = useState([]);
245}
246
247function App() {
248 return (
249 <div className="min-h-screen bg-gray-100 py-6 flex flex-col justify-center sm:py-12">
255}
256
257function client() {
258 createRoot(document.getElementById("root")).render(<App />);
259}
261if (typeof document !== "undefined") { client(); }
262
263export default async function server(request: Request): Promise<Response> {
264 const url = new URL(request.url);
265
5
6const MODELS = ["llama3.1-8b", "llama3.1-70b"];
7function App() {
8 const [messages, setMessages] = useState<Array<{ role: string; content: string }>>([]);
9 const [edits, setEdits] = useState<Array<{ id: number; content: string }>>(
125}
126
127function client() {
128 createRoot(document.getElementById("root")).render(<App />);
129}
133}
134
135async function server(request: Request): Promise<Response> {
136 if (request.method === "POST" && new URL(request.url).pathname === "/api/chat") {
137 const { messages, model } = await request.json();
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}
414}
415
416// New standalone function to drop any database
417export async function dropDatabase(dbName: string): Promise<void> {
418 try {
419 await sqlite.execute(`DROP TABLE IF EXISTS ${dbName}`);
4import Chart from "https://esm.sh/chart.js/auto";
5
6function App() {
7 const [polls, setPolls] = useState([]);
8 const [newPollQuestion, setNewPollQuestion] = useState("");
142}
143
144function client() {
145 createRoot(document.getElementById("root")).render(<App />);
146}
147if (typeof document !== "undefined") { client(); }
148
149export default async function server(request: Request): Promise<Response> {
150 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
151 const SCHEMA_VERSION = 1
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [num1, setNum1] = useState(0);
7 const [num2, setNum2] = useState(0);
93}
94
95function client() {
96 createRoot(document.getElementById("root")).render(<App />);
97}
101}
102
103export default async function server(request: Request): Promise<Response> {
104 return new Response(
105 `
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",