RobotBackupCallGraphmain.tsx15 matches
2import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL?v=2";
34export default async function server(req: Request): Promise<Response> {
5// Handle GET requests
6if (req.method === "GET") {
288layout: {
289name: 'preset',
290positions: function(node) {
291return { x: 0, y: 0 }; // Initial positions, will be overwritten
292}
297});
298299// Custom layout function
300function customLayout() {
301const mainGraph = cy.elements().not('#isolated, #isolated > node');
302const isolatedGraph = cy.getElementById('isolated');
349350// Add event listeners for highlighting
351cy.on('mouseover', 'node', function(e) {
352const node = e.target;
353highlightNodeChildrenAndParents(node);
354});
355356cy.on('mouseout', 'node', function(e) {
357unhighlightAll();
358});
359360cy.on('click', 'node', function(e) {
361const node = e.target;
362if (node.hasClass('highlighted') || node.hasClass('parent-highlighted')) {
368});
369370function highlightNodeChildrenAndParents(node) {
371const children = node.outgoers();
372const parents = node.incomers();
376}
377378function unhighlightAll() {
379cy.elements().removeClass('highlighted');
380cy.elements().removeClass('parent-highlighted');
529let match;
530while ((match = callRegex.exec(line)) !== null) {
531const calledFunction = match[1].toLowerCase();
532relationships.get(caller).add(calledFunction);
533allNodes.add(calledFunction);
534}
535});
545546const edges = [];
547relationships.forEach((calledFunctions, file) => {
548calledFunctions.forEach(calledFunction => {
549edges.push({
550data: {
551source: file,
552target: calledFunction,
553},
554});
seamlessBlushSwallowmain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
61}, [code, debouncedRenderShader]);
6263async function handleSubmit(e: React.FormEvent) {
64e.preventDefault();
65setLoading(true);
121}
122123function client() {
124createRoot(document.getElementById("root")!).render(<App />);
125}
129}
130131function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
132const gl = canvas.getContext("webgl");
133if (!gl) {
143`;
144145function createShader(gl: WebGLRenderingContext, type: number, source: string) {
146const shader = gl.createShader(type);
147if (!shader) return null;
218}
219220function extractGLSLCode(text: string): string {
221const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
222return glslMatch
225}
226227export default async function server(req: Request): Promise<Response> {
228if (req.method === "POST") {
229const anthropic = new Anthropic();
welcomingPinkAlligatormain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
79}, [code, debouncedRenderShader, retryCount]);
8081async function handleSubmit(e: React.FormEvent, shaderErrorMessage?: string) {
82if (e) e.preventDefault();
83setLoading(true);
149}
150151function client() {
152createRoot(document.getElementById("root")!).render(<App />);
153}
157}
158159function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
160const gl = canvas.getContext("webgl");
161if (!gl) {
171`;
172173function createShader(gl: WebGLRenderingContext, type: number, source: string) {
174const shader = gl.createShader(type);
175if (!shader) return null;
240}
241242function extractGLSLCode(text: string): string {
243const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
244return glslMatch
247}
248249export default async function server(req: Request): Promise<Response> {
250if (req.method === "POST") {
251const client = new Cerebras();
bsky_rss_pollmain.tsx1 match
3import { fetch } from "https://esm.town/v/std/fetch";
45export async function bsky_rss_poll() {
6const { parseFeed } = await import("https://deno.land/x/rss/mod.ts");
7const res = await fetch("https://v8.dev/blog.atom")
bsky_rss_pollREADME.md2 matches
4It's split into three parts:
51. [`bsky_rss_poll`](https://val.town/@jordan.bsky_rss_poll)
6- This function runs every hour and polls the provided RSS feed, turns it into XML and runs the check. If there *is* a new post, it tell `rss_to_bsky`to post a link (and the title) to Bluesky
72. [`latest_rss`](https://val.town/@jordan.latest_rss)
8- This is a stored object that keeps the latest object for the poll to test against
93. [`rss_to_bsky`](https://val.town/@jordan.rss_to_bsky)
10- This function turns the text post into a rich text post and posts it to Bluesky
1112Migrated from folder: Archive/bsky_rss_poll
reqEvaltownmain.tsx4 matches
1import net, { AddressInfo } from "node:net";
23export default async function(req: Request): Promise<Response> {
4return serveRequest(
5req,
6`data:text/tsx,${
7encodeURIComponent(`
8export default async function(req: Request): Promise<Response> {
9return Response.json("I am within a worker!")
10}
14}
1516export async function serveRequest(req: Request, importUrl: string): Promise<Response> {
17let port = await getFreePort();
18const worker = new Worker(`https://esm.town/v/maxm/evaltownWorker?cachebust=${crypto.randomUUID()}`, {
55});
5657export async function isPortListening(port: number): Promise<boolean> {
58let isListening = false;
59const maxWaitTime = 2000; // ms
valtowntownmain.tsx5 matches
48await contentStore.init();
4950function Town() {
51return (
52<div
69}
7071function HomePage() {
72return (
73<html>
82<form method="POST" action="/submit">
83<textarea name="handler" rows={10} cols={50} autoFocus>
84{`export default async function(req: Request) {
85return Response.json("Hello, world!");
86}`}
95}
9697function ContentPage({ handler, id }: { handler: string; id: string }) {
98return (
99<html>
122let originalContent = textarea.value;
123124textarea.addEventListener('input', function() {
125if (textarea.value !== originalContent) {
126submitButton.style.display = 'inline-block';
5import safeJsonValue from "npm:safe-json-value";
67export default async function(req: Request): Promise<Response> {
8if (req.method === "GET") {
9return new Response(indexHTML, {
1import safeJsonValue from "npm:safe-json-value";
23export async function evalCode(
4code: string,
5): Promise<{ error: { message: string; name: string; stack: string } } | any> {
43}
4445function getMainExport(
46mod: any,
47): { ok: true; value: any } | { ok: false; error: Error } {
falDemoAppmain.tsx3 matches
5import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";
67function App() {
8const [prompt, setPrompt] = useState("");
9const [imageUrl, setImageUrl] = useState("");
103}
104105function client() {
106createRoot(document.getElementById("root")).render(<App />);
107}
108if (typeof document !== "undefined") { client(); }
109110export default async function server(req: Request): Promise<Response> {
111const url = new URL(req.url);
112if (url.pathname === "/") {