36// );
37
38function parseStory(text) {
39 // Split the text into lines and remove empty lines
40 const lines = text.split("\n").filter(line => line.trim() !== "");
9import { luciaMiddleware } from "https://esm.town/v/yawnxyz/lucia_middleware_safe";
10
11function App() {
12 const [stories, setStories] = useState([]);
13 const [user, setUser] = useState(null);
174}
175
176function client() {
177 createRoot(document.getElementById("root")).render(<App />);
178}
179if (typeof document !== "undefined") { client(); }
180
181export default luciaMiddleware(async function server(request: Request): Promise<Response> {
182 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
183 const SCHEMA_VERSION = 3
11`);
12
13export default async function(req: Request): Promise<Response> {
14 const res = await db.query(`
15 UPDATE test
13const localizer = momentLocalizer(moment);
14
15function App() {
16 const [events, setEvents] = useState([]);
17 const [isLoading, setIsLoading] = useState(false);
114}
115
116function client() {
117 createRoot(document.getElementById("root")).render(<App />);
118}
120if (typeof document !== "undefined") { client(); }
121
122async function server(request: Request): Promise<Response> {
123 const { OpenAI } = await import("https://esm.town/v/std/openai");
124 const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");
12const localizer = momentLocalizer(moment);
13
14function App() {
15 const [events, setEvents] = useState([]);
16 const [isLoading, setIsLoading] = useState(false);
75}
76
77function client() {
78 createRoot(document.getElementById("root")).render(<App />);
79}
81if (typeof document !== "undefined") { client(); }
82
83async function server(request: Request): Promise<Response> {
84 const { OpenAI } = await import("https://esm.town/v/std/openai");
85 const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");
1import { PDFExtract, PDFExtractOptions } from "npm:pdf.js-extract";
2
3export default async function pdfExtractText(data: ArrayBuffer) {
4 const pdfExtract = new PDFExtract();
5 // const req = await fetch("https://morth.nic.in/sites/default/files/dd12-13_0.pdf");
3import { email } from "https://esm.town/v/std/email";
4
5async function fetchStories(type: string, count: number) {
6 const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7 const storyIds = await response.json();
15}
16
17function createStoryHTML(story: any) {
18 return `
19 <li>
28}
29
30function createEmailContent(
31 topStories: any[],
32 newStories: any[],
118}
119
120export default async function server(req: Request) {
121 try {
122 const topStories = await fetchStories("top", 10);
3import { extname, join } from "jsr:@std/path@0.225.2";
4
5export function serveGithubRepo(params: {
6 owner: string;
7 repo: string;
1export default async function (req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html>
12 float w = 400;
13
14 // Function to calculate the vertex positions
15 float[] a(float x, float y) {
16 float k = mouseX - x;
1export default async function (req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html>
13 float w = 400;
14
15 // Function to calculate the vertex positions
16 float[] a(float x, float y) {
17 float k = w * noise(t) - x;
31 for (float y = 0; y < w; y += s) {
32 for (float x = 0; x < w; x += s) {
33 // Set the stroke color based on sine functions
34 stroke(
35 128 + 128 * sin(x * 0.01 + t),
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",