hnFollowAppmain.tsx2 matches
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
45export const hnFollowApp = function(authors: string[]) {
6return async function({ lastRunAt }) {
7let posts = await hnLatestPosts({
8authors,
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);
97}
9899function client() {
100createRoot(document.getElementById("root")!).render(<App />);
101}
105}
106107function extractCodeFromFence(text: string): string {
108const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
109return htmlMatch ? htmlMatch[1].trim() : text;
110}
111112export default async function server(req: Request): Promise<Response> {
113if (req.method === "POST") {
114const client = new Cerebras();
5import { renderToString } from "npm:react-dom/server";
67function StatusRow({ rows }) {
8return (
9<div className="w-full flex flex-col space-y-2">
28}
2930function StatusSection({ url, rows }) {
31const sectionRows = rows.filter(row => row[0] === url);
32const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
4546export default async function(req: Request): Promise<Response> {
47const { rows } = await sqlite.execute(
48"select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
6);
78export async function uptimeCheck(url: string) {
9let reason: string, status: number, end: number;
10let ok = true;
weatherGPTmain.tsx1 match
31console.log(text);
3233export async function weatherGPT() {
34await email({ subject: "Weather Today", text });
35}
43}
4445function ProductCard({ product, addToCart }) {
46return (
47<div
79}
8081function ParallaxSlider() {
82const [offsetY, setOffsetY] = useState(0);
83const handleScroll = () => setOffsetY(window.pageYOffset);
112}
113114function Footer() {
115return (
116<footer className="modern-footer">
153}
154155function Sidebar() {
156return (
157<div className="sidebar">
174}
175176function App() {
177const [cart, setCart] = useState([]);
178const [isClient, setIsClient] = useState(false);
290}
291292function client() {
293const root = document.getElementById("root");
294if (root) {
309}
310311export default async function server(req: Request): Promise<Response> {
312return new Response(`
313<!DOCTYPE html>
labLoginBanUsermain.tsx1 match
2import { sqlite } from "https://esm.town/v/std/sqlite";
34export default async function(req: Request): Promise<Response> {
5const TABLE_NAME = "lab_login_users_with_times";
6const body = await req.json();
lovelyYellowXerinaemain.tsx18 matches
53};
5455// Simple sentiment analysis function (unchanged)
56function analyseSentiment(text) {
57const positiveWords = new Set([
58'good', 'great', 'excellent', 'wonderful', 'amazing', 'fantastic', 'awesome',
8485// Improved TF-IDF implementation with additional filtering
86function calculateTFIDF(text, outputSize = 7) {
87const words = text.toLowerCase().match(/\b[a-z]{2,}\b/g) || [];
88const wordCount = words.length;
133}
134135// Updated function to calculate word frequency
136function calculateWordFrequency(text, topN = 30) {
137const words = text.toLowerCase().match(/\b[a-z]{3,}\b/g) || [];
138const frequency = {};
147}
148149// Updated function to generate a fun fact
150function generateFunFact(text) {
151const wordCount = text.trim().split(/\s+/).length;
152const charCount = text.length;
168}
169170// Function to generate a simple summary (unchanged)
171function generateSummary(text, sentenceCount = 3) {
172const sentences = text.match(/[^\.!\?]+[\.!\?]+/g) || [];
173return sentences.slice(0, sentenceCount).join(' ');
174}
175176// Updated function to clean the extracted text
177function cleanText(text) {
178return text
179.replace(/<[^>]*>/g, '') // Remove HTML tags
187}
188189// Updated function to fetch and parse URL content
190async function fetchUrlContent(url) {
191try {
192console.log('Fetching URL:', url);
199const root = parse(html);
200201if (!root || typeof root.querySelectorAll !== 'function') {
202throw new Error('Failed to parse HTML content');
203}
462});
463464async function analyseText() {
465const text = inputText.value.trim();
466const url = urlInput.value.trim();
540}
541542function displayResult(data) {
543let tfidfHtml = '<br><h3>Top TF-IDF Scores:</h3>';
544tfidfHtml += '<table><tr><th>Term</th><th>Score</th><th>Synonyms</th></tr>';
634635// Client-side character count limit
636inputText.addEventListener('input', function() {
637if (this.value.length > 100000) {
638this.value = this.value.slice(0, 100000);
733});
734735export default async function(request: Request): Promise<Response> {
736return app.fetch(request);
737}
sanguineCyanMastodonmain.tsx6 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function calculateTFIDF(text, outputSize = 7) {
6const words = text.toLowerCase().match(/\b\w+\b/g) || [];
7const wordCount = words.length;
35}
3637function calculateWordFrequency(text, topN = 30) {
38const words = text.toLowerCase().match(/\b\w+\b/g) || [];
39const wordFreq = {};
50}
5152function isValidWord(word) {
53return word.length > 1;
54}
60]);
6162function App() {
63const [text, setText] = useState("");
64const [tfidfResults, setTfidfResults] = useState([]);
125}
126127function client() {
128createRoot(document.getElementById("root")).render(<App />);
129}
133}
134135export default async function(request: Request): Promise<Response> {
136return new Response(`
137<!DOCTYPE html>