sqliteExplorerAppREADME.md1 match
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
45
67## Install
sqliteExplorerAppREADME.md1 match
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
45
67## Install
23return html(render(<FavIcon emoji={emoji} />), {
24headers: {
25"Content-Type": "image/svg+xml",
26"Cache-Control": `public, max-age=${60 * 60 * 24}, s-maxage=${60 * 60 * 24 * 7}`,
27},
sparklineExmain.tsx1 match
20return new Response(htmlString, {
21headers: {
22"content-type": "image/svg+xml",
23},
24});
illustratedPrimermain.tsx26 matches
1import inputHeader from "https://esm.town/v/substrate/inputHeader";
2import { ComputeJSON, ComputeText, GenerateImage, sb, Substrate } from "npm:substrate";
3import { z } from "npm:zod";
4import { zodToJsonSchema } from "npm:zod-to-json-schema";
21});
22const prompt1 = new ComputeText({
23prompt: sb.interpolate`generate a description of an image of ${
24c1.future.json_object.get("concepts").at(0)
25}. Be creative depicting abstract topics using detailed abstract imagery. Include details on the background, angle & framing, and style.`,
26});
27const prompt2 = new ComputeText({
28prompt: sb.interpolate`generate a description of an image of ${
29c1.future.json_object.get("concepts").at(1)
30}. Be creative depicting abstract topics using detailed abstract imagery. Include details on the background, angle & framing, and style.`,
31});
32const caption1 = new ComputeText({
39${caption1.future.text}`,
40}, { cache_age: 800 });
41const image1 = new GenerateImage({ prompt: prompt1.future.text });
42const image2 = new GenerateImage({ prompt: prompt2.future.text });
43const c2 = new ComputeJSON({
44prompt: sb.interpolate`List advanced concepts related to: ${c1.future.json_object.get("concepts").at(0)}
49});
50const prompt3 = new ComputeText({
51prompt: sb.interpolate`generate a description of an image of ${
52c2.future.json_object.get("concepts").at(0)
53}. Be creative depicting abstract topics using detailed abstract imagery. Include details on the background, angle & framing, and style.`,
54});
55const prompt4 = new ComputeText({
56prompt: sb.interpolate`generate a description of an image of ${
57c2.future.json_object.get("concepts").at(1)
58}. Be creative depicting abstract topics using detailed abstract imagery. Include details on the background, angle & framing, and style.`,
59});
60const caption3 = new ComputeText({
73${caption3.future.text}`,
74});
75const image3 = new GenerateImage({ prompt: prompt3.future.text });
76const image4 = new GenerateImage({ prompt: prompt4.future.text });
77const nodes = [image1, caption1, image2, caption2, image3, caption3, image4, caption4];
78const stream = await substrate.stream(...nodes);
7984async start(controller) {
85const pairs = [
86{ image: null, caption: null, title: null },
87{ image: null, caption: null, title: null },
88{ image: null, caption: null, title: null },
89{ image: null, caption: null, title: null },
90];
9192const outputPair = (pair, index) => {
93if (pair.image && pair.caption) {
94controller.enqueue(new TextEncoder().encode(
95`<div style="display:flex;justify-content:center;align-items:center;margin-bottom:20px;">
96<div style="margin:0 10px;">${pair.image}</div>
97<div style="margin:0 10px;font-size:1.2rem;">
98<a href="/?input=${pair.title}"><b>${capitalize(pair.title)}</b></a><br/>${pair.caption}</div>
99</div>`,
100));
101pairs[index] = { image: null, caption: null, title: null }; // Reset after output
102}
103};
119if (index !== -1) {
120const pairIndex = Math.floor(index / 2);
121const isImage = index % 2 === 0;
122const content = event.data.image_uri
123? `<img src="${event.data.image_uri}" width=400/>`
124: `<div style="font-family:system-ui,sans-serif;">${event.data.text}</div>`;
125126if (isImage) {
127pairs[pairIndex].image = content;
128} else {
129pairs[pairIndex].caption = content;
umbrellaReminderREADME.md1 match
1# ☔️ Umbrella reminder if there's rain today
23
45## Setup
beigeMandrillmain.tsx3 matches
2122// Retrieve HTCI API key from environment variables
23const apiUrl = 'https://hcti.io/v1/image';
2425const apiKey = Deno.env.get("HTCI");
57return new Response(pngBuffer, {
58headers: {
59'Content-Type': 'image/png',
60'Cache-Control': 'public, max-age=604800, immutable'
61},
63} catch (error) {
64console.error('Error converting SVG to PNG:', error);
65return new Response('Error generating image', { status: 500 });
66}
67}
sqliteExplorerAppREADME.md1 match
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
45
67## Install
456
78
amethystGoldfishREADME.md1 match
1Fancy animated SVGs in readmes, along with centering and image sizing.
2```
3<div align="center"><img width=200 src="https://gpanders.com/img/DEC_VT100_terminal.jpg"></div>