1export default async function(req: Request): Promise<Response> {
2return Response.json({ data: true });
3}
flutteringVioletBirdmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [description, setDescription] = useState("Thu, Sep 26, 2024 2:25 PM EDT");
7const [dateString, setDateString] = useState("2024-09-26T14:25:00-04:00");
77}
7879function DateComponent({ dateString }) {
80if (!dateString) {
81return <div>Invalid date string provided</div>;
107);
108109function client() {
110createRoot(document.getElementById("root")).render(<App />);
111}
115}
116117export default async function server(request: Request): Promise<Response> {
118return new Response(`
119<!DOCTYPE html>
newUserWelcomeEmailmain.tsx2 matches
4import { html } from "https://esm.town/v/stevekrouse/html";
56async function sendTownieEmail() {
7try {
8await email({
19}
2021export async function newUserWelcomeEmail(req: Request): Promise<Response> {
22if (req.method === "GET") return html(welcomeEmail);
23if (req.headers.get("clerkNonSensitive") !== Deno.env.get("clerkNonSensitive"))
runescapeWoodCuttingmain.tsx4 matches
9};
1011function LoginScreen({ onLogin }) {
12const [name, setName] = useState("");
1336}
3738function App() {
39const [playerName, setPlayerName] = useState("");
40const [skill, setSkill] = useState("woodcutting");
107}
108109function client() {
110createRoot(document.getElementById("root")).render(<App />);
111}
115}
116117export default async function server(request: Request): Promise<Response> {
118const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
119const SCHEMA_VERSION = 2;
anthropicCachingmain.tsx8 matches
1/**
2* This val creates an interactive webpage that demonstrates the functionality of the Anthropic API.
3* It uses a React frontend with an input for the API key and buttons to trigger different operations.
4* The Anthropic API key is stored in the frontend state and sent with each API request.
9import { createRoot } from "https://esm.sh/react-dom/client";
1011function App() {
12const [apiKey, setApiKey] = useState("");
13const [outputs, setOutputs] = useState({
82}
8384function client() {
85createRoot(document.getElementById("root")).render(<App />);
86}
90}
9192async function server(request: Request): Promise<Response> {
93const url = new URL(request.url);
94138}
139140async function fetchContent(): Promise<string> {
141const response = await fetch("https://www.gutenberg.org/cache/epub/1342/pg1342.txt");
142const text = await response.text();
146}
147148async function runNonCachedCall(apiKey: string): Promise<string> {
149const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
150const client = new anthropic.Anthropic({ apiKey });
182}
183184async function runCachedCall(apiKey: string): Promise<string> {
185const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
186const client = new anthropic.Anthropic({ apiKey });
221}
222223async function runMultiTurnConversation(apiKey: string): Promise<string> {
224const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
225const client = new anthropic.Anthropic({ apiKey });
1export default async function(req: Request): Promise<Response> {
2const url =
3"https://global.bing.com/HPImageArchive.aspx?format=js&idx=0&n=9&pid=hp&FORM=BEHPTB&uhd=1&uhdwidth=3840&uhdheight=2160&setmkt=zh-CN&setlang=en";
switchbot_partymain.tsx8 matches
37];
3839function getPartyStatus() {
40const now = Temporal.Now.zonedDateTimeISO(NYC_TIMEZONE);
41for (const party of parties) {
53}
5455function formatTimeDifference(target, now) {
56const diff = target.since(now);
57const hours = diff.hours;
65}
6667async function switchbotRequest(path, args) {
68const token = Deno.env.get("SWITCHBOT_TOKEN");
69const secret = Deno.env.get("SWITCHBOT_KEY");
89}
9091function botPress(device) {
92return switchbotRequest(`v1.1/devices/${device}/commands`, {
93method: "POST",
102const { htmlUrl } = extractValInfo(import.meta.url);
103104function Layout({ children, title }) {
105return (
106<html>
122}
123124function Button({ children }) {
125return (
126<button class="bg-green-500 hover:bg-green-600 text-white font-bold py-3 px-6 rounded-full shadow-lg transform transition duration-200 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-green-400 focus:ring-opacity-50">
130}
131132function MainPage({ partyName }) {
133return (
134<Layout title={partyName}>
147}
148149function ErrorPage({ title, message, backLink = true }) {
150return (
151<Layout title={title}>
1# getMyValId
23Helper function for a val to get its own ID.
45## Usage
2import ValTown from "npm:@valtown/sdk";
34async function getMyValId(importMetaURL: string) {
5const vt = new ValTown();
6const { author, name } = extractValInfo(importMetaURL);
getMyValIdmain.tsx1 match
2import ValTown from "npm:@valtown/sdk";
34async function getMyValId(importMetaURL: string) {
5const vt = new ValTown();
6const { author, name } = extractValInfo(importMetaURL);