7import confetti from 'https://esm.sh/canvas-confetti';
8
9function App() {
10 const [clicks, setClicks] = useState(0);
11
49}
50
51function client() {
52 createRoot(document.getElementById("root")).render(<App />);
53}
55if (typeof document !== "undefined") { client(); }
56
57async function server(request: Request): Promise<Response> {
58 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
59 const SCHEMA_VERSION = 2
4import { generateId, Scrypt } from "npm:lucia";
5
6export async function createTables(userTable: string, sessionTable: string) {
7 return sqlite.batch([
8 `CREATE TABLE ${userTable} (
22}
23
24async function safeExecute({ userTable, sessionTable, query, error }: {
25 userTable: string;
26 sessionTable: string;
40}
41
42export async function createUser({ userTable, sessionTable, username, password, github_id, google_id }: {
43 userTable: string;
44 sessionTable: string;
65}
66
67export async function getUser(
68 { userTable, sessionTable, username, github_id, google_id }: {
69 userTable: string;
98}
99
100export async function verifyPassword(hashed_password: string, password: string): Promise<boolean> {
101 return new Scrypt().verify(hashed_password, password);
102}
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;