Search

Results include substring matches and semantically similar vals. Learn more
ibodev avatar
status
@ibodev
Uptime Status Page This is the status page for the data generated by this uptime cron: @stevekrouse/uptime
HTTP
/** @jsxImportSource https://esm.sh/react */
import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
import { html } from "https://esm.town/v/stevekrouse/html";
import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
import { renderToString } from "npm:react-dom/server";
function StatusRow({ rows }: { rows: any[] }) {
odicho avatar
bbaasfe
@odicho
The simplest possible frontend for Breadboard as a Service
Script
* Indicates that the output node should bubble up to the invoking runner,
* if any.
* This is useful for sending outputs to the user from inside of the nested
* graphs.
| "bubble"
stevekrouse avatar
subaudio
@stevekrouse
sub.audio – generate subtitles and chapters for any audio URL. Speech-to-text and chapter summaries powered by Substrate 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits
HTTP
display: none;
.side-chapter {
opacity: 0.5;
id="prev-chapter-title"
class="chapter-title-txt side-chapter"
></div>
id="next-chapter-title"
class="chapter-title-txt side-chapter"
></div>
nico avatar
whatIsMyIp
@nico
I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare provides the True-Client-IP header as well. When you run a val on the website, it is actually running from val's servers so it won't come from your client IP. You'll need to copy the express fetch and run that from your client.
Express (deprecated)
I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare pro
export let whatIsMyIp = (req: express.Request, res: express.Response) => {
const xForwardedFor = req.get("x-forwarded-for");
const ip = req.get("True-Client-IP");
res.json({
ip,
karfau avatar
chai
@karfau
// @deno-types="https://unpkg.com/@types/chai/index.d.ts"
Script
// and importing the javascript file this way works
} = chai;
// by reexporting everythin (beside `should` since it doesn't work with ESM) types work in other vals
export { assert, Assertion, AssertionError, config, expect, use, util, version };
CoachCompanion avatar
curiousTurquoiseDormouse
@CoachCompanion
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import { marked } from "https://esm.sh/marked@4.3.0";
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
const css = `
stevekrouse avatar
exponentialBackoffMiddleware
@stevekrouse
Exponential backoff middleware If your server returns a 5xx error, it will wait 1, 2, 4, 8, 16, 32, 64, 128... seconds before retrying Usage import { exponentialBackoffMiddleware } from "https://esm.town/v/stevekrouse/exponentialBackoffMiddleware" export default exponentialBackoffMiddleware(() => { /* your normal http handler * / }) Example usage: https://www.val.town/v/stevekrouse/BIGweather?v=164#L114
Script
/** @jsxImportSource npm:preact */
import { render } from "npm:preact-render-to-string";
* Exponential backoff middleware
* If your server returns a 5xx error,
willthereader avatar
ThankYouNoteGenerator
@willthereader
An interactive, runnable TypeScript val by willthereader
HTTP
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
function ThankYouCard({ note, theme, font, recipientName, senderName }) {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
export default async function server(request: Request): Promise<Response> {
stevekrouse avatar
todoListScript
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import { jsx as _jsx } from "https://esm.sh/react/jsx-runtime";
import { TodoApp } from "https://esm.town/v/stevekrouse/TodoApp";
const root = createRoot(document.getElementById("app"));
yawnxyz avatar
stitchVal
@yawnxyz
inspired by https://x.com/dankuntz/status/1813283813881225625 written by Sonnet-3.5 with ~12 prompts and some final manual tweaks
HTTP
window.addEventListener('resize', onWindowResize);
function onMouseMove(event) {
currentPoint.set(event.clientX, window.innerHeight - event.clientY);
if (isPressed) {
dragVector.subVectors(currentPoint, clickPoint);
function onMouseDown(event) {
isPressed = true;
clickPoint.set(event.clientX, window.innerHeight - event.clientY);
currentPoint.copy(clickPoint);
dragVector.set(0, 0);
liam avatar
template
@liam
Starter template for Substrate demos
HTTP
const startup_name = new ComputeText({
prompt:
`Give me a unique startup name inside <name></name> tags related to ${prompt}. Example: <name>Hyphae</name><description
const haiku = new ComputeText({
prompt: sb.concat(
std avatar
linkify
@std
linkify This is a client-side helper for linkifying URLs in error pages
Script
# linkify
This is a client-side helper for linkifying URLs in error pages
// client-side linkify for val.town error pages
import linkify from "https://esm.sh/linkify-element";
const MODULE_URL = "https://esm.town/";
ejfox avatar
calendlyThisWeekEvents
@ejfox
* This API integrates with Calendly to fetch personal events for the current week. * It returns the events as raw JSON. * * Note: This requires a Calendly Personal Access Token to be set as an environment variable.
HTTP
* It returns the events as raw JSON.
* Note: This requires a Calendly Personal Access Token to be set as an environment variable.
// Server-side code
async function server(request: Request): Promise<Response> {
const calendlyToken = Deno.env.get('CALENDLY_TOKEN');
zzz avatar
IP
@zzz
// https://api.val.town/v1/express/zzz.IP
Script
// https://api.val.town/v1/express/zzz.IP
export async function IP(req, res) {
const ip = req.get("true-client-ip") ??
req.get("x-forwarded-for")?.split(",")[0];
res.send(ip);
xkonti avatar
htmlTags
@xkonti
// CONTENT SECTIONING
Script
export function articleTag(content: HtmlContents | undefined = undefined): Tag {
return basicTag("article", content);
export function asideTag(content: HtmlContents | undefined = undefined): Tag {
return basicTag("aside", content);
export function footerTag(content: HtmlContents | undefined = undefined): Tag {
return basicTag("footer", content);