strategiesHelpersmain.tsx2 matches
777}
778779function predictDraw(teamA, teamB, tournament) {
780if (!teamA || !teamB) return 0;
781782// Helper function to calculate draw rate
783const calculateDrawRate = (team) =>
784team.results.draws / team.totalMatches;
calmRoseCaterpillarmain.tsx11 matches
39);
4041function App() {
42const [functionInput, setFunctionInput] = useState("");
43const [mermaidDiagram, setMermaidDiagram] = useState("");
44const [error, setError] = useState("");
70"Content-Type": "application/json",
71},
72body: JSON.stringify({ function: functionInput }),
73});
74102},
103body: JSON.stringify({
104functionDescription: functionInput,
105currentMermaidCode: `\`\`\`mermaid\n${mermaidDiagram}\n\`\`\``,
106}),
148<div style={styles.container}>
149<div style={styles.header}>
150<h1 style={styles.title}>🔍 Function Diagram Generator</h1>
151<p style={styles.subtitle}>Transform code into visual flowcharts</p>
152</div>
154<form onSubmit={handleSubmit} style={styles.form}>
155<textarea
156value={functionInput}
157onChange={(e) => setFunctionInput(e.target.value)}
158placeholder="Paste your function here... (JavaScript/TypeScript)"
159style={styles.textarea}
160rows={10}
334};
335336function client() {
337createRoot(document.getElementById("root")).render(<App />);
338}
339if (typeof document !== "undefined") { client(); }
340341export default async function server(request: Request): Promise<Response> {
342if (request.method === "PUT") {
343try {
372<html>
373<head>
374<title>Function Mermaid Diagram Generator</title>
375<meta name="viewport" content="width=device-width, initial-scale=1">
376<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
pythonHTTPValmain.tsx1 match
1import { runPythonCode } from "https://deno.land/x/py_town@v0.0.8/mod.ts";
23export default async function handler(req: Request): Promise<Response> {
4const pythonCode = `
5import numpy as np
postMessageButtonGamemain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function App() {
6const handlePostMessage = () => {
7window.parent.postMessage('{"data": "foo", "field": "expected", "type": "update"}', '*');
29}
3031function client() {
32createRoot(document.getElementById("root")).render(<App />);
33}
34if (typeof document !== "undefined") { client(); }
3536export default async function server(request: Request): Promise<Response> {
37return new Response(`
38<html>
wholeFoodsRSSmain.tsx1 match
2import { wholefoodssales } from "https://esm.town/v/Glench/wholefoodssales";
34export default async function(req: Request): Promise<Response> {
5return new Response(dataToRSS(await wholefoodssales(), {
6title: "Whole Foods Sales — Personal",
3import process from "node:process";
45export const tvshows = async function() {
6const TV_SHOWS_WATCHED = [
7// Ted Lasso
28data.push(show);
29}
30data.sort(function(a, b) {
31if (a.last_air_date > b.last_air_date)
32return -1;
blob_adminmain.tsx8 matches
13}
1415function Tooltip({ children, content }: TooltipProps) {
16const [isVisible, setIsVisible] = useState(false);
17const tooltipRef = useRef<HTMLDivElement>(null);
52}
5354function formatBytes(bytes: number, decimals = 2) {
55if (bytes === 0) return "0 Bytes";
56const k = 1024;
61}
6263function copyToClipboard(text: string) {
64navigator.clipboard.writeText(text).then(() => {
65console.log("Text copied to clipboard");
69}
7071function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72const [isOpen, setIsOpen] = useState(false);
73const menuRef = useRef(null);
7677useEffect(() => {
78function handleClickOutside(event) {
79if (menuRef.current && !menuRef.current.contains(event.target)) {
80event.stopPropagation();
158}
159160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161const [isLoading, setIsLoading] = useState(false);
162const decodedKey = decodeURIComponent(blob.key);
219}
220221function App({ initialEmail, initialProfile }) {
222const encodeKey = (key: string) => encodeURIComponent(key);
223const decodeKey = (key: string) => decodeURIComponent(key);
645}
646647function client() {
648const initialEmail = document.getElementById("root").getAttribute("data-email");
649const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));
pyodideSetupmain.tsx1 match
1const pyodideUrl = "https://cdn.jsdelivr.net/pyodide/v0.26.4/full/";
23export async function initializePyodide() {
4// Set up the global objects that Pyodide expects
5(globalThis as any).window = globalThis;
3import { Marp } from "npm:@marp-team/marp-core";
45export default async function() {
6const { author, name } = extractValInfo(import.meta.url);
7const { readme } = await api(`/v1/alias/${author}/${name}`);
weatherGPTmain.tsx1 match
31console.log(text);
3233export async function weatherGPT() {
34await email({ subject: "Weather Today", text });
35}