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}
113}).toString().split("\n").slice(1).slice(0, -1).join("\n")
114115async function getRows() {
116const result = await sqlite.execute(`SELECT * FROM ${TABLE_NAME}`)
117const rows = result.rows.map(r => ({
126type Rows = Awaited<ReturnType<typeof getRows>>
127128app.get("/api", async function apiRoute(c) {
129try {
130return c.json(await getRows())
160})
161162export default async function(req: Request): Promise<Response> {
163await sqlite.execute(`
164CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
notUberHomemain.tsx1 match
117};
118119export function Home() {
120return (
121<div className="p-0 md:p-4">