Search

Results include substring matches and semantically similar vals. Learn more
pomdtr avatar
fets
@pomdtr
Fets Example A openapi JSON spec is available at https://pomdtr-fets.web.val.run/openapi.json . You can access a fully typed client with a single import: import { client } from "https://esm.town/v/pomdtr/fets"; const resp = await client["/greetings"].get(); const res = await resp.json(); console.log(res.message);
HTTP
A openapi JSON spec is available at <https://pomdtr-fets.web.val.run/openapi.json>.
You can access a fully typed client with a single import:
```typescript
import { client } from "https://esm.town/v/pomdtr/fets";
const resp = await client["/greetings"].get();
const res = await resp.json();
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { createClient, createRouter, Response } from "npm:fets@0.7.1";
export const router = createRouter({
const val = extractValInfo(import.meta.url);
export const client = createClient<typeof router>({
fetchFn: router.fetch,
vinaysaxenaofficial avatar
prodigiousLimeTyrannosaurus
@vinaysaxenaofficial
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 **/
import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
export default (req: Request) => {
return new Response(
charmaine avatar
empatheticBlackClam
@charmaine
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY
HTTP
dragOffsetX = event.clientX - tile.offsetLeft;
dragOffsetY = event.clientY - tile.offsetTop;
const lensCenterX = event.clientX;
const lensCenterY = event.clientY;
const tileRect = tiles[i].getBoundingClientRect();
draggedTile.style.left = `${Math.min(Math.max(event.clientX - dragOffsetX, 0), maxX)}px`;
draggedTile.style.top = `${Math.min(Math.max(event.clientY - dragOffsetY, 0), maxY)}px`;
const binRect = bins[i].getBoundingClientRect();
if (event.clientX > binRect.left && event.clientX < binRect.right && event.clientY > binRect.top && event
dragOffsetX = event.clientX - newTile.offsetLeft;
Mistercz avatar
cerebras_coder
@Mistercz
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY Todos I'm looking for collaborators to help. Fork & send me PRs! [ ] Experiment with two prompt chain (started here )
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
// Moved STARTER_PROMPTS directly into this val
thomasatflexos avatar
generateEmbeddings
@thomasatflexos
An interactive, runnable TypeScript val by thomasatflexos
Script
const { OpenAIEmbeddings } = await import("npm:langchain/embeddings");
const { createClient } = await import(
"https://esm.sh/@supabase/supabase-js@2"
"npm:langchain/document_loaders/web/cheerio"
const client = createClient(
process.env.supabaseURL,
openAIApiKey: process.env.OPEN_API_KEY,
client,
tableName: "documents",
vtdocs avatar
emailGithubReactions
@vtdocs
An interactive, runnable TypeScript val by vtdocs
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export const emailGithubReactions = async () => {
const username = "stevekrouse";
event.type === "IssueCommentEvent" && event.payload.action === "created"
const recentReactions = [];
for (const comment of comments) {
for (
const reaction of await fetchJSON(
comment.payload.comment.reactions.url,
if (msAgo(15 * msMinute)) {
recentReactions.push(
`${reaction.user.login} reacted with ${reaction.content} to ${comment.payload.comment.html_url}`,
if (recentReactions.length > 0) {
await email({
text: recentReactions.join("\n"),
subject: "new github reactions!",
nuklearfiziks avatar
bigLeagueMe
@nuklearfiziks
Big League yourself! WARNING, this will unfollow every user you follow!
Script
// Ex: user.bsky.social
const handle = params.HANDLE || "";
// YOUR bluesky password, or preferably an App Password (found in your client settings)
// Ex: abcd-1234-efgh-5678
const password = params.PASS || "";
maxm avatar
useTheLibraryThatNeedsValidation
@maxm
An interactive, runnable TypeScript val by maxm
Script
import { newClient } from "https://esm.town/v/maxm/libraryThatNeedsValidation";
try {
let client = await newClient("maxm", "wrong");
} catch (err) {
console.log(err);
let client = await newClient("maxm", "password");
console.log("logged in and validated", client.getUsername());
Meghana avatar
engagingPurpleDormouse
@Meghana
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 **/
import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
export default (req: Request) => {
// Use global btoa() method for base64 encoding
liamdanielduffy avatar
myReactComponent
@liamdanielduffy
// assumes React is in scope, and returns a valid HTML script string for rendering a React Component
Script
// assumes React is in scope, and returns a valid HTML script string for rendering a React Component
export function myReactComponent() {
return `
const Example = () => {
return React.createElement("div", null, "Hello, React!");
ReactDOM.render(React.createElement(Example), document.getElementById("root"));
stevekrouse avatar
falSDXLExample
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
import { html } from "https://esm.town/v/stevekrouse/html";
import * as fal from "npm:@fal-ai/serverless-client";
fal.config({
// Can also be auto-configured using environment variables:
iamseeley avatar
webPerformance
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP
const websites = [
{ name: 'React-Client', url: 'https://iamseeley-reactserver.web.val.run/' },
{ name: 'React-Client-CDN', url: 'https://iamseeley-clientmultiroutereact.web.val.run/' },
{ name: 'Vue', url: 'https://iamseeley-multiroutevue.web.val.run/' },
{ name: 'Svelte', url: 'https://iamseeley-multiroutesvelte.web.val.run/' },
{ name: 'Preact', url: 'https://iamseeley-multiroutepreact.web.val.run/' },
{ name: 'React', url: 'https://iamseeley-multiroutereact.web.val.run/' },
{ name: 'Hono', url: 'https://iamseeley-multiroutehono.web.val.run/' },
andreterron2 avatar
react
@andreterron2
An interactive, runnable TypeScript val by andreterron2
Script
export const react = await import("npm:react");
arfan avatar
kanbanTodoList
@arfan
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { DragDropContext, Draggable, Droppable } from "https://esm.sh/react-beautiful-dnd@13.1.1";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
function TaskBoard() {
</div>
function client() {
createRoot(document.getElementById("root")).render(<TaskBoard />);
if (typeof document !== "undefined") {
client();
export default async function server(request: Request): Promise<Response> {
yawnxyz avatar
turnitdown
@yawnxyz
HTML to Markdown Converter This is a simple web application that converts HTML to Markdown. It provides a clean and efficient way to transform HTML content into Markdown format, which is widely used for documentation and content creation. Features Easy-to-use Interface : Simple textarea inputs for HTML and Markdown output. Real-time Conversion : Converts HTML to Markdown instantly upon clicking the convert button. Clean Output : Removes scripts, styles, and other non-content elements from the HTML before conversion. Copy to Clipboard : One-click copying of the converted Markdown text. How It Works The application uses the Hono framework to create a simple web server. HTMX is used for handling AJAX requests without writing JavaScript. Alpine.js provides reactivity for the clipboard functionality. The Turndown library is used to convert HTML to Markdown. Usage Paste your HTML content into the "HTML Input" textarea. Click the "Convert to Markdown" button. The converted Markdown will appear in the "Markdown Output" textarea. Use the "Copy to Clipboard" button to easily copy the result. Technical Details The server removes <script> , <style> , and other non-content tags before conversion. HTML comments are also stripped out. The Markdown output is cleaned to remove excessive whitespace and newlines. View Source You can view the source code of this application by clicking the "View Source" link at the bottom of the page. Limitations The converter may not handle extremely complex HTML structures perfectly. Some HTML elements might not have a direct Markdown equivalent. Future Improvements Add options for customizing the Markdown output format. Implement file upload for HTML conversion. Add support for converting Markdown back to HTML. Feel free to use and modify this converter for your HTML to Markdown conversion needs!
HTTP
2. HTMX is used for handling AJAX requests without writing JavaScript.
3. Alpine.js provides reactivity for the clipboard functionality.
4. The Turndown library is used to convert HTML to Markdown.
* This val creates a simple web interface using Hono framework to convert HTML to Markdown.
* It uses HTMX for dynamic updates and Alpine.js for reactivity.
* The Turndown library is used for HTML to Markdown conversion.
* The interface includes two text areas (input and output) and buttons for conversion and copying.