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/$%7Bsuccess?q=function&page=2519&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 28846 results for "function"(1756ms)

violetKoalamain.tsx3 matches

@void•Updated 9 months ago
1async function fetchWeather() {
2 const API_KEY = "439d4b804bc8187953eb36d2a8c26a02"; // Example key, replace with your own
3 const LAT = 51.5074; // London latitude
22}
23
24function generateHTML(weather, url) {
25 if (!weather || !weather.current) {
26 console.error("Weather data not available");
61}
62
63export default async function main(req) {
64 const weather = await fetchWeather();
65 const url = `http://api.openweathermap.org/data/2.5/forecast/daily?q=London&appid=439d4b804bc8187953eb36d2a8c26a02`;

superchargedQueryParamsmain.tsx1 match

@neverstew•Updated 9 months ago
23const pairPattern = /([a-zA-Z0-9_-]+)([=!<>]=?|[<>])(.+)/;
24
25export function superchargedQueryParams(url: URL): ParsedQuery {
26 return decodeURIComponent(url.search)
27 .slice(1)

lostKeysmain.tsx5 matches

@moe•Updated 9 months ago
15let hueBase
16
17export function setup() {
18 canvasSize = 800
19 numberOfSquares = Math.floor(random(4, 10))
34}
35
36export function draw() {
37 background(0)
38
49}
50
51function drawSquare(x, y) {
52 let inset = gridSize * 0.06
53 let size = gridSize - inset
97}
98
99export function keyPressed() {
100 if (key == "i") {
101 saveCanvas("p5js-" + new Date().getTime(), "png")
105 }
106}
107// export function touchEnded() {
108// saveCanvas("p5js-" + new Date().getTime(), "png");
109// }

dateme_homemain.tsx1 match

@iamseeley•Updated 9 months ago
4import Layout from "https://esm.town/v/stevekrouse/dateme_layout";
5
6export default function Home(c) {
7 const AutocompleteInput = () => {
8 const [inputValue, setInputValue] = useState('');

thomasResumeHandlermain.tsx1 match

@ttodosi•Updated 9 months ago
4import { resumeConfig } from 'https://esm.town/v/iamseeley/thomasResumeConfig';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {

linkInBioTemplatemain.tsx1 match

@ttodosi•Updated 9 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

dailyStandupBotmain.tsx1 match

@ttodosi•Updated 9 months ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),

spotifymain.tsx1 match

@MichaelNollox•Updated 9 months ago
12}
13
14export default async function main(req: Request): Promise<Response> {
15 if (req.method === "GET") {
16 // Retrieve and return all comments

sqliteExplorerAppREADME.md1 match

@ttodosi•Updated 9 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

dateme_browse_reactmain.tsx7 matches

@stevekrouse•Updated 9 months ago
5import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
6
7function absoluteURL(url) {
8 if (url.startsWith("http://") || url.startsWith("https://"))
9 return url;
25let linkClass = "text-sky-600 hover:text-sky-500";
26
27function httpsIfy(url: string) {
28 if (!url.startsWith("http://") && !url.startsWith("https://")) {
29 return `https://${url}`;
33
34// TODO - refactor this into a Cell React component
35function renderCell(header, row) {
36 let data = row[header];
37 if (header === "Name") {
47}
48
49function convertParams(url) {
50 const params = new URL(url).searchParams;
51 const search = {
62const metersInMile = 1609.34;
63
64function withinRadius(
65 profileLocation: string[],
66 searchLocation: { lat: number; lon: number },
75}
76
77export async function loader({ request }) {
78 "use server"; // this is not a real feature; just me reminding myself I'm on the server
79 const { zip } = await import("npm:lodash-es");
117}
118
119export function Browse() {
120 const search = convertParams(window.location.href);
121 const { profiles } = useLoaderData() as any; // TODO - get good typing
tuna

tuna9 file matches

@jxnblk•Updated 5 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.