snakeclonemain.tsx5 matches
7const CELL_SIZE = CANVAS_SIZE / GRID_SIZE;
89function ChatRoom() {
10const [messages, setMessages] = useState([]);
11const [inputMessage, setInputMessage] = useState('');
46}
4748function SnakeGame() {
49const [snake, setSnake] = useState([{ x: 10, y: 10 }]);
50const [food, setFood] = useState({ x: 15, y: 15 });
127}
128129function App() {
130const [currentView, setCurrentView] = useState('menu');
131157}
158159function mountApp() {
160const root = document.getElementById("root");
161if (root) {
166}
167168async function server(request: Request): Promise<Response> {
169return new Response(`
170<html>
missingRosePonymain.tsx1 match
4import { currency } from "https://esm.town/v/stevekrouse/currency";
56export default async function btcPriceAlert() {
7const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8let btcPrice = await currency("usd", "btc");
weekWorkoutIconsmain.tsx1 match
4import { addDays, format } from "npm:date-fns@2.30.0";
56export function weekWorkoutIcons(
7byDay: Record<string, any>,
8timezone: string = "America/Los_Angeles",
setTidbytImagemain.tsx1 match
7];
89export async function setTidbytImage({ image }: {
10image: string;
11}) {
scientificCyanHarriermain.tsx3 matches
4import { vtTokenSessionAuth } from "https://esm.town/v/stevekrouse/vtTokenSessionAuthSafe";
56function App() {
7const [tables, setTables] = useState([]);
8const [selectedTable, setSelectedTable] = useState(null);
214}
215216function client() {
217createRoot(document.getElementById("root")).render(<App />);
218}
222}
223224async function server(request: Request): Promise<Response> {
225try {
226const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
whoIsHiringHomemain.tsx1 match
2import { Dispatch } from "https://esm.sh/react";
34export default function Home(
5dispatch: Dispatch<{
6type: string;
tidbytStarmain.tsx1 match
1import { tidbytCircle } from "https://esm.town/v/andreterron/tidbytCircle";
23export async function tidbytStar({ size = 7, bg = 0x047857ff, star = 0xffffffff }: {
4size?: number;
5bg?: number;
1import { Database } from "https://esm.sh/duckdb-async";
23export default async function server(request: Request): Promise<Response> {
4const url = new URL(request.url);
5const dataUrl = url.searchParams.get('url');
cohostSanitizemain.tsx1 match
214};
215216export function cohostSanitize(html: string, document: Document): Node {
217const unsafeTree = fromHtml(html, { fragment: true });
218const safeTree = sanitize(unsafeTree, FIFTH_AGE.schema);
restfulJsonBlobApimain.tsx9 matches
8const BLOB_PREFIX = "items_";
910export default async function server(request: Request): Promise<Response> {
11const url = new URL(request.url);
12const path = url.pathname;
58}
5960async function getAllItems() {
61const keys = await blob.list(BLOB_PREFIX);
62const items = await Promise.all(
69}
7071async function getItem(id: string) {
72return await blob.getJSON(`${BLOB_PREFIX}${id}`);
73}
7475async function createItem(item: any) {
76const id = crypto.randomUUID();
77await blob.setJSON(`${BLOB_PREFIX}${id}`, item);
79}
8081async function updateItem(id: string, item: any) {
82await blob.setJSON(`${BLOB_PREFIX}${id}`, item);
83}
8485async function deleteItem(id: string) {
86await blob.delete(`${BLOB_PREFIX}${id}`);
87}
8889function jsonResponse(data: any, headers: HeadersInit, status = 200) {
90return new Response(JSON.stringify(data), {
91headers: { ...headers, "Content-Type": "application/json" },
94}
9596function notFoundResponse(headers: HeadersInit) {
97return new Response("Not Found", { headers, status: 404 });
98}
99100function getInstructions() {
101return `
102JSON Blob Storage API