githubreposearchmain.tsx1 match
1export default async function fetchNewPublicGitHubRepos() {
2// Generate today's date in YYYY-MM-DD format
3const today = new Date().toISOString().split("T")[0];
mosaiclipsemain.tsx4 matches
36let colorPalette: any
3738export function setup() {
39tileCount = Math.floor(random(5, 9))
40tileSize = canvasSize / tileCount
45}
4647export function draw() {
48let colorindex = Math.floor(random(colorPalette.length))
49background(colorPalette[colorindex % colorPalette.length])
70}
7172export function keyPressed() {
73if (key == "i") {
74saveCanvas("p5js-" + new Date().getTime(), "png")
78}
79}
80// export function touchEnded() {
81// saveCanvas("p5js-" + new Date().getTime(), "png");
82// }
computeScheduleREADME.md1 match
1# `computeSchedule` function
2Combines several schedule segments together to form a complete schedule for a 24-hour period.
3
4import { render } from "npm:preact-render-to-string";
56export const sha256 = async function digestMessage(message) {
7const msgUint8 = new TextEncoder().encode(message); // encode as (utf-8) Uint8Array
8const hashBuffer = await crypto.subtle.digest("SHA-256", msgUint8); // hash the message
18);
1920function BasicLayout(props) {
21return (
22<html>
33}
3435export default async function(req: Request): Promise<Response> {
36const url = new URL(req.url);
37if (req.method === "POST") {
94{` var cookies = document.getElementById('cookies');
95var login = document.getElementById('login');
96cookies.onchange = function () {
97login.disabled = false;//!this.checked;
98}`}
lightGrayCrowmain.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);
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