Search

Results include substring matches and semantically similar vals. Learn more
tmcw avatar
handlebarsExample
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export let handlebarsExample = (async () => {
const { default: Handlebars } = await import("npm:handlebars");
let source =
"<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " +
"{{kids.length}} kids:</p>" +
"<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
let template = Handlebars.compile(source);
let data = {
"name": "Alan",
"hometown": "Somewhere, TX",
stevekrouse avatar
honoJSX
@stevekrouse
@jsxImportSource https://esm.sh/hono@3.9.2/jsx
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/hono@3.9.2/jsx **/
const Layout: FC = (props) => {
return (
<html>
<body>{props.children}</body>
</html>
const Top: FC<{ messages: string[] }> = (props: { messages: string[] }) => {
return (
<Layout>
<h1>Hello Hono!</h1>
stevekrouse avatar
exampleTldJS
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import tldjs from "npm:tldjs";
export let exampleTldJS = tldjs.parse("https://stevekrouse-blogrss.web.val.run/");
stevekrouse avatar
googleClient
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export const googleClient = async () => {
const { google } = await import("npm:googleapis");
const key = { client_id: "test", client_secret: "test" };
const client = new google.auth.OAuth2(key.client_id, key.client_secret, [
"https://example.com",
return client;
herku avatar
aqi
@herku
An interactive, runnable TypeScript val by herku
Script
export let aqi = async () => {
let pm25 = (
await fetchJSON(
"https://api.openaq.org/v2/latest?" +
new URLSearchParams({
limit: "10",
page: "1",
location: "Tbilisi",
offset: "0",
sort: "desc",
pomdtr avatar
VALLE
@pomdtr
Fork it and authenticate with your Val Town API token as the password. Needs an OPENAI_API_KEY env var to be set. WARNING: pollutes your homepage with lots of temporary vals!! https://x.com/JanPaul123/status/1812957150559211918
HTTP (deprecated)
Fork it and authenticate with your Val Town API token as the password. Needs an `OPENAI_API_KEY` env var to be set.
WARNING: pollutes your homepage with lots of temporary vals!!
https://x.com/JanPaul123/status/1812957150559211918
/** @jsxImportSource https://esm.sh/react */
const vt = new ValTown({ bearerToken: Deno.env.get("valtown") });
const username = "janpaul123";
const app = new Hono();
const jsxResponse = (jsx) => {
return new Response(renderToString(jsx), { headers: { "Content-Type": "text/html" } });
const systemprompt = `The conversation below is your recent interaction with the user.
mrick avatar
llmTS
@mrick
An interactive, runnable TypeScript val by mrick
Script
export const llmTS = (async () => {
const { LLM, MODEL } = await import("npm:llm.ts");
return new LLM({
apiKeys: {
huggingface: process.env.HF_API_TOKEN,
}).completion({
prompt: [
'Repeat the following sentence: "I am a robot."',
'Repeat the following sentence: "I am a human."',
model: ["gpt2"],
steve_townie avatar
lastlogin_demo
@steve_townie
HTTP (deprecated)
![Screenshot 2024-08-08 at 08.48.41.gif](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7442086d-36b2-454d-bd5f-3c28615e900
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
app.get("/", (c) => {
const email = c.req.header("X-LastLogin-Email");
if (email) {
return c.html(
<div>
<h1>Welcome, {email}!</h1>
<a href="/auth/logout">Logout</a>
maxm avatar
test_explorer_router
@maxm
@jsxImportSource npm:hono/jsx
Script
/** @jsxImportSource npm:hono/jsx */
createHistory,
type HistoryEntry,
readHistory,
writeHistory,
} from "https://esm.town/v/pomdtr/test_explorer_history";
const router = new Hono();
const me = await api("/v1/me", { authenticated: true });
const author = me.username;
router.get("/", async (c) => {
cathy avatar
testcron
@cathy
An interactive, runnable TypeScript val by cathy
Script
import { mathFact } from "https://esm.town/v/cathy/mathFact";
let { hello } = await import("https://esm.town/v/cathy/hello");
export let testcron = () => {
hello += `${mathFact}\n`;
return hello;
jxnblk avatar
VALLErun
@jxnblk
The actual code for VALL-E: https://www.val.town/v/janpaul123/VALLE
HTTP (deprecated)
The actual code for VALL-E: https://www.val.town/v/janpaul123/VALLE
/** @jsxImportSource https://esm.sh/react */
function parseSearchReplaceBlocks(content: string): Array<{ searchStart: string; searchEnd: string; replace: string }> {
content = content.replaceAll("\r\n", "\n");
const regex =
/\[SEARCH_START_SINGLE_LINE\]\n([\s\S]*?)\n\[\/SEARCH_START_SINGLE_LINE\]\s*\[SEARCH_END_SINGLE_LINE\]\n([\s\S]*?)\n?\[\/
const blocks = [];
let match;
while ((match = regex.exec(content)) !== null) {
blocks.push({
janpaul123 avatar
valle_tmp_25273384802368385202566002443081
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
// Set these to your own
const username = "janpaul123";
const tempValsParentFolderId = "4bb7b010-4443-11ef-8642-de64eea55b61";
const valTownToken = Deno.env.get("valtown");
const vt = new ValTown({ bearerToken: valTownToken });
const app = new Hono();
const jsxResponse = (jsx) => {
return new Response(renderToString(jsx), { headers: { "Content-Type": "text/html" } });
const systemprompt = `The conversation below is your recent interaction with the user.
stevekrouse avatar
yellowSpider
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { jsPython } from "npm:jspython-interpreter";
const interpreter = jsPython()
.addFunction("fetch", fetch);
const script = `
print(fetch("https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects").text())
await interpreter.evaluate(script);
maxm avatar
repp
@maxm
repp
HTTP (deprecated)
repp
/** @jsxImportSource https://esm.sh/react */
const oneSecond = 1000;
const TIMEOUT = 5 * oneSecond;
blob.setJSON;
const fetch = async (req: Request): Promise<Response> => {
let repp = new Repp([{
code: "",
code: ``,
if (req.method === "GET") {
tfayyaz avatar
searchmessages
@tfayyaz
@jsxImportSource npm:hono/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono/jsx **/
// import val sqlite
const app = new Hono();
const title = "Click Button Demo";
const View = ({ rows }) => {
// create search form
// create html table from all rows
return (
<html>
<head>