Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=function&page=1621&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 19289 results for "function"(2070ms)

generatevoiceREADME.md1 match

@dglazkov•Updated 10 months ago
1An example of using [Breadboard Board as a Service](https://www.val.town/v/dglazkov/bbaas) helper script. The board converts supplied text and voice into speech using Eleven Labs API.
2
3This board is marked as `private`, which means that it requires an additional service key to function.
4
5To use:

cronEvalLoggermain.tsx2 matches

@neverstew•Updated 10 months ago
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
6
7type CronFunction = (interval: Interval) => Promise<void>;
8
9export const cronEvalLogger = (cron: CronFunction): CronFunction => {
10 let interval: Interval;
11 const cronProxy = new Proxy(cron, {

blobCommentsReactmain.tsx1 match

@stevekrouse•Updated 10 months ago
6import { blob } from "https://esm.town/v/std/blob?v=10";
7
8function App() {
9 const [comments, setComments] = useState();
10 const [newComment, setNewComment] = useState("");

sqliteExplorerAppREADME.md1 match

@hunty•Updated 10 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37

sendNotificationmain.tsx1 match

@doublelotus•Updated 10 months ago
4 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3";
5
6async function run() {
7 const imageUrl =
8 "https://prodimage.images-bn.com/lf?set=key%5Bresolve.pixelRatio%5D,value%5B1%5D&set=key%5Bresolve.width%5D,value%5B600%5D&set=key%5Bresolve.height%5D,value%5B10000%5D&set=key%5Bresolve.imageFit%5D,value%5Bcontainerwidth%5D&set=key%5Bresolve.allowImageUpscaling%5D,value%5B0%5D&set=key%5Bresolve.format%5D,value%5Bwebp%5D&source=url%5Bhttps://prodimage.images-bn.com/pimages/9780063345164_p0_v3_s600x595.jpg%5D&scale=options%5Blimit%5D,size%5B600x10000%5D&sink=format%5Bwebp%5D";

sendNotificationREADME.md1 match

@doublelotus•Updated 10 months ago
3This val can be used in other vals to send notifications to a segment using [OneSignal's REST API](https://documentation.onesignal.com/reference/create-notification)
4
5This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to [Netlify](https://www.netlify.com/) for free. OneSignal has [easy to follow docs](https://documentation.onesignal.com/docs/web-sdk-setup) so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then [install the PWA](https://www.bitcot.com/how-to-install-a-pwa-to-your-device/) on your platform of choice and you're off to the races!
6
7## Setup

duckdbExamplemain.tsx1 match

@hamilton•Updated 10 months ago
2
3export let duckdbExample = (async () => {
4 async function createWorker(url: string) {
5 const workerScript = await fetch(url);
6 const workerURL = URL.createObjectURL(await workerScript.blob());

webPerformancemain.tsx3 matches

@iamseeley•Updated 10 months ago
11];
12
13async function measurePerformance(url) {
14 const start = Date.now();
15 const response = await fetch(url);
46}
47
48async function compareWebsites() {
49 const results = [];
50 const totalWebsites = websites.length;
78}
79
80export default async function handler(req: Request): Promise<Response> {
81 try {
82 console.log("Starting performance tests...");

automergeDemomain.tsx1 match

@stevekrouse•Updated 10 months ago
6await automerge.next.initializeBase64Wasm(automergeWasmBase64);
7
8export default async function(req: Request): Promise<Response> {
9 // from https://automerge.org/automerge/api-docs/js/
10 type DocType = { ideas: Array<automerge.Text> };

getYenPriceBlobmain.tsx1 match

@kayla_lin•Updated 10 months ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const history = await blob.getJSON("daily");
5

getFileEmail4 file matches

@shouser•Updated 2 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 3 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",