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/?q=function&page=1512&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 17289 results for "function"(2355ms)

octopusAgilePricingmain.tsx1 match

@MattieTK•Updated 1 year ago
14 results: OctopusPrice[];
15};
16export async function octopusAgilePricing(location: string): Promise<OctopusPrice> {
17 const locationMap = {
18 "London": "C",

plumGazellemain.tsx1 match

@lufafajoshua•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
1export default async function handler(request: Request) {
2 if (request.method === "GET") {
3 return new Response(
9 <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.3/dist/tailwind.min.css" rel="stylesheet">
10 <script>
11 function handleSubmit(event) {
12 event.preventDefault();
13 var dreamInput = document.getElementById('dreamInput');

dot_commain.tsx3 matches

@horatiothomas•Updated 1 year ago
15const dateClass = "text-xs text-gray-400 font-mono mr-1 hidden sm:inline-block";
16
17async function getHits() {
18 const [, , { rows: [[allHits]] }, { rows: [[todayHits]] }] = await sqlite.batch([
19 "CREATE TABLE IF NOT EXISTS stevekrouse_com_hits (timestamp DATETIME DEFAULT CURRENT_TIMESTAMP)",
192 <li className="pb-2 sm:pb-1">
193 <span className={dateClass}>2016 Jul -</span>
194 <Link href="https://medium.com/@stevekrouse/the-trick-to-teach-anonymous-functions-to-11-year-olds-558b697d7a53">
195 The Trick to Teach Anonymous Functions to 11-Year-Olds
196 </Link>
197 </li>

dream_interpretermain.tsx1 match

@horatiothomas•Updated 1 year ago
1export default async function(interval) {
2 // Sample phrases and words that are likely to appear in dream descriptions
3 const introPhrases = [

framemain.tsx1 match

@nlnw•Updated 1 year ago
6const app = new Hono();
7
8async function renderImage(s: string, color: string) {
9 const fontArrayBuf = await fetch(
10 "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-regular-webfont.ttf",

handleSavePageFormmain.tsx1 match

@rwev•Updated 1 year ago
3import { email } from "https://esm.town/v/std/email?v=11";
4
5export async function handleSavePageForm(req: Request) {
6 const formData = await req.formData();
7 const text = formData.get("text");

pageEntriesDbmain.tsx3 matches

@rwev•Updated 1 year ago
2import { sqlite } from "https://esm.town/v/std/sqlite";
3
4export async function getLatestPageEntryDb() {
5 let latestVersion = await sqlite.execute(`select * from pages where id = (select max(id) from pages);`);
6 return sqliteRowsAsObject(latestVersion)[0];
7}
8
9export async function getAllPageEntriesDb() {
10 let allVersions = await sqlite.execute(`select * from pages order by id desc`);
11 return sqliteRowsAsObject(allVersions);
12}
13
14export async function savePageEntryDb(textValue) {
15 const insertResult = await sqlite.execute({
16 sql: `insert into pages (value) values (:value)`,

viewSourcemain.tsx1 match

@stevekrouse•Updated 1 year ago
4import { escape } from "npm:html-sloppy-escaper";
5
6export default modifyFetchHandler(async function(req: Request) {
7 const pathname = new URL(req.url).searchParams.get("url");
8 const html = await fetchText(pathname ?? "example.com"); // .then(prettifyHtml);

orangeAngelfishmain.tsx1 match

@wannli•Updated 1 year ago
1export async function getFieldValue(req) {
2 const url = new URL(req.url);
3 let symbol = url.searchParams.get("symbol") || "";

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",