vttThumbMakermain.tsx6 matches
20export default app.fetch;
2122function html() {
23/*
24<!DOCTYPE html>
83}
8485function css() {
86/*
87body {
218}
219220function js() {
221/*
222const fileInput = document.getElementById('fileInput');
242let thumbnailMetadata;
243244function updateUI() {
245generateBtn.disabled = files.length === 0;
246thumbWidth.disabled = keepAspectRatio.checked;
247}
248249function resetToStep1() {
250thumbnailOptions.style.display = 'block';
251renderOptions.style.display = 'none';
377});
378379function getImage(file) {
380return new Promise((resolve) => {
381const url = URL.createObjectURL(file);
seamlessBlushSwallowmain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
61}, [code, debouncedRenderShader]);
6263async function handleSubmit(e: React.FormEvent) {
64e.preventDefault();
65setLoading(true);
121}
122123function client() {
124createRoot(document.getElementById("root")!).render(<App />);
125}
129}
130131function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
132const gl = canvas.getContext("webgl");
133if (!gl) {
143`;
144145function createShader(gl: WebGLRenderingContext, type: number, source: string) {
146const shader = gl.createShader(type);
147if (!shader) return null;
218}
219220function extractGLSLCode(text: string): string {
221const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
222return glslMatch
225}
226227export default async function server(req: Request): Promise<Response> {
228if (req.method === "POST") {
229const anthropic = new Anthropic();
welcomingPinkAlligatormain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
79}, [code, debouncedRenderShader, retryCount]);
8081async function handleSubmit(e: React.FormEvent, shaderErrorMessage?: string) {
82if (e) e.preventDefault();
83setLoading(true);
149}
150151function client() {
152createRoot(document.getElementById("root")!).render(<App />);
153}
157}
158159function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
160const gl = canvas.getContext("webgl");
161if (!gl) {
171`;
172173function createShader(gl: WebGLRenderingContext, type: number, source: string) {
174const shader = gl.createShader(type);
175if (!shader) return null;
240}
241242function extractGLSLCode(text: string): string {
243const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
244return glslMatch
247}
248249export default async function server(req: Request): Promise<Response> {
250if (req.method === "POST") {
251const client = new Cerebras();
welcomingPinkAlligatormain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
79}, [code, debouncedRenderShader, retryCount]);
8081async function handleSubmit(e: React.FormEvent, shaderErrorMessage?: string) {
82if (e) e.preventDefault();
83setLoading(true);
149}
150151function client() {
152createRoot(document.getElementById("root")!).render(<App />);
153}
157}
158159function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
160const gl = canvas.getContext("webgl");
161if (!gl) {
171`;
172173function createShader(gl: WebGLRenderingContext, type: number, source: string) {
174const shader = gl.createShader(type);
175if (!shader) return null;
240}
241242function extractGLSLCode(text: string): string {
243const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
244return glslMatch
247}
248249export default async function server(req: Request): Promise<Response> {
250if (req.method === "POST") {
251const client = new Cerebras();
bsky_rss_pollmain.tsx1 match
3import { fetch } from "https://esm.town/v/std/fetch";
45export async function bsky_rss_poll() {
6const { parseFeed } = await import("https://deno.land/x/rss/mod.ts");
7const res = await fetch("https://v8.dev/blog.atom")
bsky_rss_pollREADME.md2 matches
4It's split into three parts:
51. [`bsky_rss_poll`](https://val.town/@jordan.bsky_rss_poll)
6- This function runs every hour and polls the provided RSS feed, turns it into XML and runs the check. If there *is* a new post, it tell `rss_to_bsky`to post a link (and the title) to Bluesky
72. [`latest_rss`](https://val.town/@jordan.latest_rss)
8- This is a stored object that keeps the latest object for the poll to test against
93. [`rss_to_bsky`](https://val.town/@jordan.rss_to_bsky)
10- This function turns the text post into a rich text post and posts it to Bluesky
1112Migrated from folder: Archive/bsky_rss_poll
extractValInfomain.tsx1 match
1export function extractValInfo(url: string | URL) {
2const { pathname, search } = new URL(url);
3const [author, filename] = pathname.split("/").slice(-2);
specialBlackMosquitomain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6return (
7<div>
11}
1213function client() {
14createRoot(document.getElementById("root")).render(<App />);
15}
16if (typeof document !== "undefined") { client(); }
1718export default async function server(request: Request): Promise<Response> {
19return new Response(`
20<html>
slackScoutmain.tsx10 matches
15}
1617export default async function(interval: Interval): Promise<void> {
18try {
19await createTable();
3839// Create an SQLite table
40async function createTable(): Promise<void> {
41await sqlite.execute(`
42CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
5051// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53return hackerNewsSearch({
54query: topic,
58}
5960async function fetchTwitterResults(topic: string): Promise<Website[]> {
61return twitterSearch({
62query: topic,
67}
6869async function fetchRedditResults(topic: string): Promise<Website[]> {
70return redditSearch({ query: topic });
71}
7273function formatSlackMessage(website: Website): string {
74const displayTitle = website.title || website.url;
75return `*<${website.url}|${displayTitle}>*
78}
7980async function sendSlackMessage(message: string): Promise<Response> {
81const slackWebhookUrl = Deno.env.get("SLACK_WEBHOOK_URL");
82if (!slackWebhookUrl) {
104}
105106async function isURLInTable(url: string): Promise<boolean> {
107const result = await sqlite.execute({
108sql: `SELECT 1 FROM ${TABLE_NAME} WHERE url = :url LIMIT 1`,
112}
113114async function addWebsiteToTable(website: Website): Promise<void> {
115await sqlite.execute({
116sql: `INSERT INTO ${TABLE_NAME} (source, url, title, date_published)
120}
121122async function processResults(results: Website[]): Promise<void> {
123for (const website of results) {
124if (!(await isURLInTable(website.url))) {
12* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.