wittyTurquoiseDovemain.tsx12 matches
12}
1314function QuickCommand({ label, onClick }: { label: string; onClick: () => void }) {
15return (
16<button className="quick-command" onClick={onClick}>
20}
2122function App() {
23const [prompt, setPrompt] = useState("hello llamapalooza");
24const [code, setCode] = useState("");
104label: "Mobile-First Layout",
105prompt:
106"Design a Mobile-First Layout that prioritizes mobile device usability and performance, ensuring that the design scales up effectively for larger screens while maintaining functionality and aesthetics on smaller devices.",
107},
108{
208}, []);
209210async function fetchSavedSnippets() {
211const response = await fetch("/snippets");
212const snippets = await response.json();
214}
215216async function handleSave() {
217if (!code) return;
218const response = await fetch("/snippets", {
226}
227228async function handleDelete(id: number) {
229const response = await fetch(`/snippets/${id}`, { method: "DELETE" });
230if (response.ok) {
233}
234235async function handleSubmit(e: React.FormEvent) {
236e.preventDefault();
237setLoading(true);
257}
258259function handleBack() {
260if (currentIndex > 0) {
261setCurrentIndex(currentIndex - 1);
264}
265266function handleForward() {
267if (currentIndex < history.length - 1) {
268setCurrentIndex(currentIndex + 1);
391}
392393function client() {
394createRoot(document.getElementById("root")!).render(<App />);
395}
399}
400401function extractCodeFromFence(text: string): string {
402const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
403return htmlMatch ? htmlMatch[1].trim() : text;
404}
405406export default async function server(req: Request): Response {
407const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
408const KEY = "wittyTurquoiseDove";
zwiftPortalScheduleREADME.md1 match
47import { email } from "https://esm.town/v/std/email";
4849export default async function sendZwiftPortalSchedule(interval: Interval) {
50console.log("Parsing Zwift portal road schedule...");
51
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});
createFileInputAppmain.tsx1 match
1export default function server(req: Request): Response {
2return new Response(`
3<!DOCTYPE html>
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [isDragging, setIsDragging] = useState(false);
7const [jsonResult, setJsonResult] = useState(null);
124}
125126function client() {
127createRoot(document.getElementById("root")).render(<App />);
128}
130if (typeof document !== "undefined") { client(); }
131132export default async function server(req: Request): Promise<Response> {
133// Handle image processing
134if (req.method === 'POST' && new URL(req.url).searchParams.get('process')) {
btcPriceAlertmain.tsx1 match
4import { currency } from "https://esm.town/v/stevekrouse/currency";
56export async function btcPriceAlert() {
7const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8let btcPrice = await currency("usd", "btc");
btcPriceAlertmain.tsx1 match
4import { currency } from "https://esm.town/v/stevekrouse/currency";
56export async function btcPriceAlert() {
7const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8let btcPrice = await currency("usd", "btc");
squishyformmain.tsx14 matches
39let currentHistoryIndex = -1;
4041function updateStore(newData, source) {
42const currentData = $parsedResult.get();
43if (JSON.stringify(newData) !== JSON.stringify(currentData)) {
757677function undo() {
78if (currentHistoryIndex > 0) {
79currentHistoryIndex--;
83}
8485function redo() {
86if (currentHistoryIndex < history.length - 1) {
87currentHistoryIndex++;
105});
106107function debounce(func, delay) {
108return function() {
109const context = this;
110const args = arguments;
118inputText.addEventListener('input', debouncedSubmit);
119120function startTimer() {
121startTime = Date.now();
122stopTimer(); // Ensure any existing timer is stopped
124}
125126function stopTimer() {
127clearInterval(timerInterval);
128timerInterval = null; // Clear the interval reference
132}
133134function updateTimer() {
135const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
136timerDisplay.textContent = elapsedTime + 's llama3-groq-8b-8192';
137}
138
139async function submitForm() {
140const input = inputText.value.trim();
141const system = systemText.value.trim();
209let isEditorFocused = false;
210211function updateResultText(data) {
212const existingMonacoEditor = result.querySelector('#monaco-editor');
213
220221require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.30.1/min/vs' }});
222require(['vs/editor/editor.main'], function() {
223editor = monaco.editor.create(editorContainer, {
224value: JSON.stringify(data, null, 2),
289}
290291function updateTable(data) {
292if (!result.querySelector('#resultTable')) {
293const table = document.createElement('table');
359}
360361function createEmptyRow() {
362const row = document.createElement('tr');
363const keyCell = document.createElement('td');
379}
380381function createEditableInput(value, key, type) {
382const input = document.createElement('input');
383input.type = 'text';
qrCodeWebhookmain.tsx5 matches
7}
89function generateQrSVGPaths(
10qrData: boolean[][],
11penWidth: number,
20const overlap = true;
2122function createPath(
23startX: number,
24startY: number,
30}
3132function visitRow(visited: boolean[][], y: number, startX: number, endX: number) {
33for (let x = startX; x <= endX; x++) {
34visited[y][x] = true;
36}
3738function visitColumn(visited: boolean[][], x: number, startY: number, endY: number) {
39for (let y = startY; y <= endY; y++) {
40visited[y][x] = true;
113}
114115export default async function(request: Request): Promise<Response> {
116if (request.method !== "POST" && request.method !== "GET") {
117return new Response("Method Not Allowed", { status: 405 });
webdavServermain.tsx1 match
7};
89export function serveVals(
10req: Request,
11options?: WebdavOptions,