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/image-url.jpg%20%22Image%20title%22?q=function&page=2535&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 28792 results for "function"(2191ms)

clientOnlymain.tsx1 match

@aretrace•Updated 10 months ago
2import React from 'https://esm.sh/react'
3
4export function ClientOnly({ children, ...delegated }) {
5 const [hasMounted, setHasMounted] = React.useState(false)
6 React.useEffect(() => {

cuetipmain.tsx3 matches

@pinjasaur•Updated 10 months ago
11const getText = async url => (await fetch(url)).text();
12
13function generateSCSS(vars) {
14 let scss = [];
15 for (const v in vars)
22}
23
24async function generateBanner() {
25 const pkg = await getJSON("https://raw.githubusercontent.com/Pinjasaur/cuetip/master/package.json");
26 return [
32}
33
34export default async function(req: Request): Promise<Response> {
35 if (req.method === "OPTIONS") {
36 return new Response(null, {

OpenAIStreamingmain.tsx1 match

@mjweaver01•Updated 10 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2export default async function(req: Request): Promise<Response> {
3 const openai = new OpenAI();
4 const stream = await openai.chat.completions.create({

htmlExamplemain.tsx1 match

@nbaschez•Updated 10 months ago
1// View at https://andreterron-htmlExample.web.val.run?name=Andre
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4

similarSitesmain.tsx1 match

@stevekrouse•Updated 10 months ago
4const exa = new Exa(exaSecret);
5
6const similarSites = async function(url: string) {
7 const results = await exa.findSimilar(url);
8 if (results.results) {

sendSMSmain.tsx2 matches

@yawnxyz•Updated 10 months ago
8};
9
10export async function sendSMS(phoneNumber: string, message: string, carrier: string): Promise<void> {
11 const carrierDomain = carriers[carrier.toLowerCase()];
12 if (!carrierDomain) {
22 text: message,
23 });
24 console.log('Email function returned:', result);
25 console.log('SMS sent successfully');
26 } catch (error) {

sqliteExplorerAppREADME.md1 match

@yawnxyz•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

sqliteExplorerAppREADME.md1 match

@pom421•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

similarSitesmain.tsx1 match

@peterzakin•Updated 10 months ago
4const exa = new Exa(exaSecret);
5
6const similarSites = async function(url: string) {
7 const results = await exa.findSimilar(url);
8 if (results.results) {

favmain.tsx2 matches

@karkowg•Updated 10 months ago
4import { render } from "npm:preact-render-to-string";
5
6function FavIcon({ emoji }: { emoji: string }) {
7 return (
8 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 100 100">
14}
15
16export default async function(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.