Afolabis2server.tsx2 matches
1import { parseProject } from "https://esm.town/v/std/utils@71-main/index.ts";
23function getContentType(filepath: string): string {
4// If no extension or empty path, default to text/html
5if (filepath === "" || filepath === "/" || !filepath.includes(".")) {
2728const projectVal = parseProject(import.meta.url);
29export default async function(req: Request): Promise<Response> {
30const url = new URL(req.url);
31const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;
11```ts
12const projectVal = parseProject(import.meta.url);
13export default async function(req: Request): Promise<Response> {
14const url = new URL(req.url);
15const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;
denoViteserver.tsx2 matches
1import { parseProject } from "https://esm.town/v/std/utils@71-main/index.ts";
23function getContentType(filepath: string): string {
4// If no extension or empty path, default to text/html
5if (filepath === "" || filepath === "/" || !filepath.includes(".")) {
2728const projectVal = parseProject(import.meta.url);
29export default async function(req: Request): Promise<Response> {
30const url = new URL(req.url);
31const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;
11```ts
12const projectVal = parseProject(import.meta.url);
13export default async function(req: Request): Promise<Response> {
14const url = new URL(req.url);
15const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;
testPondiversemain1 match
7import user from "./user";
89export default async function(req: Request): Promise<Response> {
10let url = new URL(req.url);
11const path = url.pathname.toLowerCase();
testPondiverseaddCreation1 match
4import { TABLE_NAME } from "./updateTable";
56export default async function(req: Request): Promise<Response> {
7// body contains:
8// - title (string)
gordwameSVGComponent.tsx1 match
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
45export function SVGComponent({
6width,
7height,
gordwamequeries.ts5 matches
23// gets a random 8 or 10 letter word and uses the letters to generate the board
4export async function newBoard(seed = "seed", length = 12) {
5try {
6const query = `
56return output;
57} catch (error) {
58console.error("Error in newBoard function:", error);
5960// Return a default board in case of error
74}
7576function isOnBoard(word, board) {
77if (!word || !board || word.length !== board.length) return false;
78100}
101102function wordbankQuery(wordbank: string, min: number = 3, max: number = 16) {
103// iteratively create a replace(replace(...)) template for SQLite query
104// the idea is to take every word in the list and replace all of the letters in the wordbank with an empty string
122}
123124export async function solutions(
125board: { position: number; inner: string; outer: string; flipped: boolean }[],
126) {
1/** @jsxImportSource https://esm.sh/preact */
2import { JSX, FunctionalComponent } from "npm:preact"
3import { render } from "npm:preact-render-to-string"
456export default function handler(request: Request) {
7return new Response(render(<html>
8<head>
48}
4950const Stack: FunctionalComponent<StackProps> = ({
51direction,
52gap,
91}
9293export const VStack: FunctionalComponent<BoxProps> = (props) => (
94<Stack direction="column" {...props} />
95)
9697export const HStack: FunctionalComponent<BoxProps> = (props) => (
98<Stack direction="row" {...props} />
99)
107108109const Image: FunctionalComponent<ImageProps> = (props) => {
110const { src, w, h, fit, children, style, className, ...rest } = props
111const altText = children?.toString() || ''
135}
136137const Header: FunctionalComponent<HeaderProps> = (props) => {
138const { size = 1, p, m, style, className, children, ...rest } = props
139const Tag = (`h${size}` as keyof JSX.IntrinsicElements) as any
157158159const Text: FunctionalComponent<TextProps> = (props) => {
160const { alignX, p, m, style, className, children, ...rest } = props
161const computedStyle = {
178}
179180const GenericButton: FunctionalComponent<ButtonProps> = (props) => {
181const { variant = 'primary', p, m, style, className, children, ...rest } = props
182const computedStyle = {
198}
199200const Button = function (props: ButtonProps) {
201return <GenericButton {...props} />
202}
203Button.Outline = function (props: ButtonProps) {
204return <GenericButton variant="outline" {...props} />
205}
206Button.Primary = function (props: ButtonProps) {
207return <GenericButton variant="primary" {...props} />
208}
209Button.Secondary = function (props: ButtonProps) {
210return <GenericButton variant="secondary" {...props} />
211}
217}
218219const Link: FunctionalComponent<LinkProps> = (props) => {
220const { p, m, style, className, children, ...rest } = props
221const computedStyle = {
232}
233234function App() {
235return (
236<VStack gap="32" alignX="center" alignY="center" p="16" h="screen">
stevensDemosetupDbTables.ts1 match
2// Run this script manually to create the database table
34export default async function setupTelegramChatDb() {
5try {
6// Import SQLite module