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);
4import * as d3 from "https://esm.sh/d3";
56function App() {
7const svgRef = useRef();
8const [cables, setCables] = useState([]);
34.text("INSTRUO");
3536// Function to create a knob
37function createKnob(x, y, radius, label, labelY) {
38const knob = svg.append("g")
39.attr("transform", `translate(${x}, ${y})`);
95createKnob(340, 450, 25, "SUB", 45);
9697// Function to create a jack input
98function createJack(x, y, label) {
99const jack = svg.append("g")
100.attr("transform", `translate(${x}, ${y})`);
160const cableGroup = svg.append("g").attr("class", "cables");
161
162function updateCables() {
163const cableElements = cableGroup.selectAll("path")
164.data(cables);
200}
201202function client() {
203createRoot(document.getElementById("root")).render(<App />);
204}
206if (typeof document !== "undefined") { client(); }
207208export default async function server(req: Request): Promise<Response> {
209return new Response(`
210<html>
laserCutterSimulatormain.tsx3 matches
76};
7778function App() {
79const [position, setPosition] = useState({ x: 0, y: 0 });
80const [isLaserOn, setIsLaserOn] = useState(false);
199}
200201function client() {
202createRoot(document.getElementById("root")).render(<App />);
203}
205if (typeof document !== "undefined") { client(); }
206207async function server(request: Request): Promise<Response> {
208return new Response(`
209<html>
v2FanFicScrapermain.tsx10 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
4// last stable version is 47
5function App() {
6const [url, setUrl] = useState("");
7const [result, setResult] = useState(null);
104}
105106function client() {
107console.log("Initializing client-side React application");
108createRoot(document.getElementById("root")).render(<App />);
116const _REGEX_POST_URL = /posts\/(?<id>\d+)/;
117118function normalizeUrl(url) {
119const threadMatch = url.match(_REGEX_THREAD_URL);
120const postMatch = url.match(_REGEX_POST_URL);
128}
129130async function scrapePage(url) {
131console.log(`Starting to scrape page: ${url}`);
132const apiKey = await getApiKey();
165}
166167function processThreadmarks(threadmarks) {
168return threadmarks.map(tm => {
169let category = "1";
201}
202203async function scrapePageWithRules(url, apiKey, extractRules) {
204console.log(`Sending request to ScrapingBee API for URL: ${url}`);
205try {
245}
246247function processResults(results) {
248console.log("Processing results:", JSON.stringify(results, null, 2));
249if (!results || results.length === 0) {
275}
276277function processPost(post) {
278return {
279id: post.id,
286}
287288async function getApiKey() {
289const apiKey = Deno.env.get("ScrapingBeeAPIkey");
290if (!apiKey) {
295}
296297export default async function server(request) {
298console.log(`Received ${request.method} request for path: ${new URL(request.url).pathname}`);
299if (request.method === "POST" && new URL(request.url).pathname === "/scrape") {
count_visitsmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [websiteUrl, setWebsiteUrl] = useState("");
7const [embedCode, setEmbedCode] = useState("");
61}
6263function client() {
64createRoot(document.getElementById("root")).render(<App />);
65}
69}
7071async function server(request: Request): Promise<Response> {
72const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
73const SCHEMA_VERSION = 1;
92import { useState, useEffect } from 'react';
9394function VisitorCounter() {
95const [count, setCount] = useState(0);
96
8});
910export default async function(req: Request) {
11if (req.method === "POST") {
12const formData = await req.formData();
whoIsHiringmain.tsx3 matches
7import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
89function App() {
10const tabs = { "/": "Home", "/about": "About" };
11const [activeTab, setActiveTab] = useState("/");
335}
336337function ServerApp() {
338return (
339<html>
358}
359360export default async function(req: Request): Promise<Response> {
361const url = new URL(req.url);
362if (url.pathname === "/api/stories") {
imagesToPDFmain.tsx6 matches
15import { Hono } from 'npm:hono';
1617function html() {
18/*
19<!DOCTYPE html>
38}
3940function css() {
41/*
42body {
82}
8384function js() {
85/*
86const { jsPDF } = window.jspdf;
91convertBtn.addEventListener('click', convertToPDF);
9293async function convertToPDF() {
94const files = imageInput.files;
95if (files.length === 0) {
121}
122123function readFileAsDataURL(file) {
124return new Promise((resolve, reject) => {
125const reader = new FileReader();
130}
131132function loadImage(blob) {
133return new Promise((resolve, reject) => {
134const src = URL.createObjectURL(blob);
satisfactoryBlushCatsharkmain.tsx2 matches
2import { base58 } from "npm:@scure/base";
34export function convertUUIDToToken(uuid: string): string {
5return "vt_" + base58.encode(Buffer.from(uuid.replace(/-/g, ""), "hex"));
6}
78export function generateAndConvertUUIDs() {
9const uuidBuffer = Buffer.alloc(16);
10let tokenLength = 0;
bedtimeStoryMakermain.tsx2 matches
41const identifier = "bedtime-story-limiter";
4243async function enforceRateLimit() {
44const ratelimit = await unkey.limit(identifier);
4552const app = new Hono();
5354function parseStory(text) {
55// Split the text into lines and remove empty lines
56const lines = text.split("\n").filter(line => line.trim() !== "");