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?q=function&page=2469&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 29010 results for "function"(1736ms)

blitheTomatoDragonflymain.tsx1 match

@adambuilds•Updated 8 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

aqimain.tsx1 match

@adambuilds•Updated 8 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

pushmain.tsx1 match

@jrmann100•Updated 8 months ago
88<script src="https://cdn.jsdelivr.net/gh/philfung/add-to-homescreen@1.9/dist/add-to-homescreen.min.js"></script>
89<script>
90document.addEventListener('DOMContentLoaded', function () {
91 window.AddToHomeScreenInstance = new window.AddToHomeScreen({
92 appName: 'ValPush',

todoToolsmain.tsx1 match

@romannurik•Updated 8 months ago
8)`);
9
10export default async function(request: Request) {
11 return await serveTools(request, {
12 ListTodos: {

passionateBeigeButterflyREADME.md1 match

@stevekrouse•Updated 8 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

tvshowsmain.tsx2 matches

@tmcw•Updated 8 months ago
3import process from "node:process"
4
5export const tvshows = async function() {
6 const TV_SHOWS_WATCHED = [
7 // Ted Lasso
32 data.push(show)
33 }
34 data.sort(function(a, b) {
35 if (a.last_air_date > b.last_air_date)
36 return -1

getAppleDevicemain.tsx1 match

@tmcw•Updated 8 months ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5"
2
3export async function getAppleDevice(req: Request) {
4 const deviceId = new URL(req.url).searchParams.get("search_keywords") as string
5 if (!deviceId) return Response.json("Please provide a search_keywords query parameter")

replaceEmojisWithImagesmain.tsx1 match

@tmcw•Updated 8 months ago
1export async function replaceEmojisWithImages(
2 req: express.Request,
3 res: express.Response,

hiraganaWordBuildermain.tsx4 matches

@ashryanio•Updated 8 months ago
54};
55
56function HiraganaWordBuilder() {
57 const [currentWord, setCurrentWord] = useState({ romaji: "", hiragana: "" });
58 const [userInput, setUserInput] = useState([]);
245}
246
247function App() {
248 return (
249 <div className="min-h-screen bg-gray-100 py-6 flex flex-col justify-center sm:py-12">
255}
256
257function client() {
258 createRoot(document.getElementById("root")).render(<App />);
259}
261if (typeof document !== "undefined") { client(); }
262
263export default async function server(request: Request): Promise<Response> {
264 const url = new URL(request.url);
265

scholarlyIvoryWombatmain.tsx3 matches

@stevekrouse•Updated 8 months ago
5
6const MODELS = ["llama3.1-8b", "llama3.1-70b"];
7function App() {
8 const [messages, setMessages] = useState<Array<{ role: string; content: string }>>([]);
9 const [edits, setEdits] = useState<Array<{ id: number; content: string }>>(
125}
126
127function client() {
128 createRoot(document.getElementById("root")).render(<App />);
129}
133}
134
135async function server(request: Request): Promise<Response> {
136 if (request.method === "POST" && new URL(request.url).pathname === "/api/chat") {
137 const { messages, model } = await request.json();
tuna

tuna9 file matches

@jxnblk•Updated 19 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.