naughtyRedTunamain.tsx4 matches
3import { email } from "https://esm.town/v/std/email";
45async function fetchStories(type: string, count: number) {
6const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7const storyIds = await response.json();
15}
1617function createStoryHTML(story: any) {
18return `
19<li>
28}
2930function createEmailContent(
31topStories: any[],
32newStories: any[],
118}
119120export default async function server(req: Request) {
121try {
122const topStories = await fetchStories("top", 10);
hackerNewsDigestmain.tsx4 matches
3import { email } from "https://esm.town/v/std/email";
45async function fetchStories(type: string, count: number) {
6const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7const storyIds = await response.json();
15}
1617function createStoryHTML(story: any) {
18return `
19<li>
28}
2930function createEmailContent(
31topStories: any[],
32newStories: any[],
118}
119120export default async function server(req: Request) {
121try {
122const topStories = await fetchStories("top", 10);
3import { renderToString } from "https://esm.sh/react-dom/server";
45function createScreenBuffer(width: number, height: number): string[][] {
6const buffer: string[][] = [];
7for (let y = 0; y < height; y++) {
150};
151152function bufferToHtml(buffer: string[][], colors: any): string {
153let html = "<pre style=\"line-height: 1; font-family: monospace;\">";
154for (let y = 0; y < buffer.length; y++) {
212}
213214function App() {
215return (
216<div>
228}
229230export default async function server(request: Request): Promise<Response> {
231const app = renderToString(<App />);
232349let screensaverInterval;
350351function applyTheme(theme) {
352document.body.style.backgroundColor = theme.background;
353document.body.style.color = theme.text;
362}
363364function changeTheme() {
365currentThemeIndex = (currentThemeIndex + 1) % themeNames.length;
366const newTheme = themes[themeNames[currentThemeIndex]];
369}
370371function bufferToHtml() {
372let html = '<pre style="line-height: 1; font-family: monospace;">';
373const currentTheme = themes[themeNames[currentThemeIndex]];
432}
433434function growTreePart(y, x, type, life, direction = 0) {
435if (life <= 0) return null;
436480}
481482function growTree() {
483buffer = Array(height).fill().map(() => Array(width).fill(" "));
484growQueue = [{ x: Math.floor(width / 2), y: height - 1, type: 0, life: 32, direction: 0 }];
485
486function grow() {
487if (growQueue.length === 0) return;
488523}
524525function updateTree() {
526document.getElementById('tree-container').innerHTML = bufferToHtml();
527setTimeout(() => {
534}
535536function toggleScreensaver() {
537screensaverMode = !screensaverMode;
538document.body.classList.toggle('screensaver-mode', screensaverMode);
hackerNewsDigestmain.tsx4 matches
3import { email } from "https://esm.town/v/std/email";
45async function fetchStories(type: string, count: number) {
6const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7const storyIds = await response.json();
15}
1617function createStoryHTML(story: any) {
18return `
19<li>
28}
2930function createEmailContent(
31topStories: any[],
32newStories: any[],
118}
119120export default async function server(req: Request) {
121try {
122const topStories = await fetchStories("top", 10);
netsaur_xorREADME.md1 match
1# Approximate the XOR function using netsaur
230 xor 0 = 0.003461432410404086 (should be close to 0)
spottySilverHawkmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [activeButton, setActiveButton] = useState(null);
775}
7677function client() {
78createRoot(document.getElementById("root")).render(<App />);
79}
81if (typeof document !== "undefined") { client(); }
8283export default async function server(request: Request): Promise<Response> {
84return new Response(`
85<!DOCTYPE html>
bellTrackermain.tsx3 matches
12const GRID_SIZE = 8;
1314function App() {
15const [audioEnabled, setAudioEnabled] = useState(false);
16const [audioState, setAudioState] = useState("Initializing");
248}
249250function client() {
251createRoot(document.getElementById("root")).render(<App />);
252}
253if (typeof document !== "undefined") { client(); }
254255export default async function server(request: Request): Promise<Response> {
256return new Response(
257`
brokenBellsmain.tsx3 matches
25];
2627function App() {
28const [audioEnabled, setAudioEnabled] = useState(false);
29const [timeline, setTimeline] = useState([]);
230}
231232function client() {
233createRoot(document.getElementById("root")).render(<App />);
234}
235if (typeof document !== "undefined") { client(); }
236237export default async function server(request: Request): Promise<Response> {
238return new Response(
239`
17];
1819function App() {
20const [username, setUsername] = useState("stevekrouse");
21const [contributionData, setContributionData] = useState(null);
323}
324325function client() {
326createRoot(document.getElementById("root")).render(<App />);
327}
328if (typeof document !== "undefined") { client(); }
329330export default async function server(request: Request): Promise<Response> {
331if (request.method === "POST" && new URL(request.url).pathname === "/contributions") {
332const { username } = await request.json();
359}
360361async function fetchGitHubContributions(username: string) {
362const query = `
363query($username: String!) {
valleBlogV0main.tsx4 matches
8import _ from "npm:lodash@4";
910async function main(req: Request): Promise<Response> {
11const { readable, writable } = new TransformStream();
12const writer = writable.getWriter();
20<script>
21// Scroll to the bottom of the page when the page changes.
22(new MutationObserver(function (mutationsList, observer) {
23window.scrollTo({ left: 0, top: document.body.scrollHeight, behavior: "instant" });
24})).observe(document, { childList: true, characterData: true, subtree: true });
47Your response should start with \`\`\`ts and end with \`\`\`, so full code fences.
48There should be no comments like "more content here", it should be complete and directly runnable.
49The val should have an "export default async function main". The val should return a valid HTML website.
50Prefer using Tailwind. Put frontend functions in a <script> tag, using dangerouslySetInnerHTML. Don't use Hono. Don't use Response.redirect.
51`.replace("\n", " "),
52},