fullWebsiteVersionmain.tsx7 matches
1async function findBrokenLinks(websiteUrl) {
2console.log("Version: " + import.meta.url.match(/[?&]v=([^&]*)/)?.at(1));
3console.log(`Starting findBrokenLinks for website: ${websiteUrl}`);
7const allCheckedLinks = new Set();
8const allBrokenLinks = [];
9// Function to check if a URL is valid and accessible
10async function checkUrl(url) {
11console.log(`Checking URL: ${url}`);
12try {
26}
2728// Function to ensure URL is absolute and classify link type
29function processUrl(baseUrl, href) {
30try {
31if (
191}
192193export default async function(interval) {
194console.log(`Starting broken link check at ${new Date().toISOString()}`);
195const url = "https://dateme.directory/browse";
202console.log("External broken links:", JSON.stringify(results.brokenLinks.external, null, 2));
203} catch (error) {
204console.error(`Error in main function: ${error.message}`);
205}
206}
BBslackScoutmain.tsx10 matches
15}
1617export default async function(interval: Interval): Promise<void> {
18try {
19await createTable();
3839// Create an SQLite table
40async function createTable(): Promise<void> {
41await sqlite.execute(`
42CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
5051// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53return hackerNewsSearch({
54query: topic,
58}
5960async function fetchTwitterResults(topic: string): Promise<Website[]> {
61return twitterSearch({
62query: topic,
67}
6869async function fetchRedditResults(topic: string): Promise<Website[]> {
70return redditSearch({ query: topic });
71}
7273function formatSlackMessage(website: Website): string {
74const displayTitle = website.title || website.url;
75return `*<${website.url}|${displayTitle}>*
78}
7980async function sendSlackMessage(message: string): Promise<Response> {
81const slackWebhookUrl = Deno.env.get("SLACK_WEBHOOK_URL");
82if (!slackWebhookUrl) {
104}
105106async function isURLInTable(url: string): Promise<boolean> {
107const result = await sqlite.execute({
108sql: `SELECT 1 FROM ${TABLE_NAME} WHERE url = :url LIMIT 1`,
112}
113114async function addWebsiteToTable(website: Website): Promise<void> {
115await sqlite.execute({
116sql: `INSERT INTO ${TABLE_NAME} (source, url, title, date_published)
120}
121122async function processResults(results: Website[]): Promise<void> {
123for (const website of results) {
124if (!(await isURLInTable(website.url))) {
falProxyRequestmain.tsx1 match
1export async function falProxyRequest(req: Request) {
2const method = req.method;
3const body = method === "GET" || method === "HEAD" ? undefined : await req.text();
cerebras_codermain.tsx5 matches
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
78function App() {
9const [prompt, setPrompt] = useState("hello llamapalooza");
10const [code, setCode] = useState("");
18>(null);
1920async function handleSubmit(e: React.FormEvent) {
21e.preventDefault();
22setLoading(true);
92}
9394function client() {
95createRoot(document.getElementById("root")!).render(<App />);
96}
100}
101102function extractCodeFromFence(text: string): string {
103const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
104return htmlMatch ? htmlMatch[1].trim() : text;
105}
106107export default async function server(req: Request): Promise<Response> {
108if (req.method === "POST") {
109const client = new Cerebras();
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';
ethereumAddressGeneratormain.tsx4 matches
4import { ethers } from "https://esm.sh/ethers@5.7.2";
56function CopyableField({ label, value }) {
7const copyToClipboard = () => {
8navigator.clipboard.writeText(value).then(() => {
22}
2324function App() {
25const [wallet, setWallet] = useState(null);
2651}
5253function client() {
54createRoot(document.getElementById("root")).render(<App />);
55}
57if (typeof document !== "undefined") { client(); }
5859export default async function server(request: Request): Promise<Response> {
60return new Response(`
61<html>
1export default async function(req: Request): Promise<Response> {
2// Setup CORS Headers
3const headers = new Headers();
discordActivityClientmain.tsx5 matches
11});
1213async function setupDiscordSdk() {
14await discordSdk.ready();
157374/**
75* This function fetches the current voice channel over RPC. It then creates a
76* text element that displays the voice channel's name
77*/
78async function appendVoiceChannelName() {
79const app = document.querySelector("#app");
80if (!app) {
104105/**
106* This function utilizes RPC and HTTP apis, in order show the current guild's avatar
107* Here are the steps:
108* 1. From RPC fetch the currently selected voice channel, which contains the voice channel's guild id
111* 4. Append to the UI an img tag with the related information
112*/
113async function appendGuildAvatar() {
114const app = document.querySelector("#app");
115if (!app) {
blobbyFacemain.tsx4 matches
262728async function streamToBuffer(stream) {
29const chunks = [];
30const reader = stream.getReader();
41}
4243async function detectFileType(buffer) {
44const type = await fileTypeFromBuffer(buffer);
45// return type ? type.mime : 'unknown';
515253export async function get(key, c) {
54let result = await blobby.get(key);
55// console.log('raw result for key:', result, typeof result);
211newKeyName: '',
212213init: async function() {
214console.log('blobby:', this.blobby);
215},