6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;
1/** @jsxImportSource https://esm.sh/react */
2
3export function SparklineSVG({ strokeWidth, data, height, width, fill, stroke }) {
4 const padding = 2;
5 const xMargin = 25;
14 const yMid = (yMin + yMax) / 2;
15
16 // Scaling functions
17 const xScale = x => ((x - xMin) / (xMax - xMin)) * (width - 2 * padding) + padding + xMargin;
18 const yScale = y => height - padding - ((y - yMin) / (yMax - yMin)) * (height - 2 * padding);
3import { parseHTML } from "npm:linkedom@0.15";
4
5export default async function() {
6 const document = parseHTML("<a>").document;
7 const chart = Plot.plot({
1This Frankenstein of an example shows how well Hono, htmx, and Alpine play together.
2- Hono serves the frameworks, API calls, and functions
3- htmx handles ajax requests, and can very powerfully request html and other content to swap out the front-end
4- alpine handles app-like reactivity without having to always resort to server round trips
1export function generateFish() {
2 const fishEmojis = ['๐', '๐ ', '๐ก', '๐ฌ', '๐ณ', '๐', '๐', '๐ฆ', '๐ฆ', '๐ฆ'];
3 let fish = '';
4import { resumeConfig } from 'https://esm.town/v/iamseeley/resumeConfig';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });
1import { html } from "https://esm.town/v/stevekrouse/html";
2
3export default async function (req: Request): Promise<Response> {
4 return html(`
5 <!DOCTYPE html>
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });
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": "*",