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=1602&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 18995 results for "function"(3810ms)

dateme_browsemain.tsx4 matches

@vawogbemi•Updated 10 months ago
5import { zip } from "npm:lodash-es";
6
7function absoluteURL(url) {
8 if (url.startsWith("http://") || url.startsWith("https://"))
9 return url;
24let linkClass = "text-sky-600 hover:text-sky-500";
25
26function httpsIfy(url: string) {
27 if (!url.startsWith("http://") && !url.startsWith("https://")) {
28 return `https://${url}`;
31}
32
33function renderCell(header, row) {
34 let data = row[header];
35 if (header === "Name") {
49}
50
51export default async function Browse(c) {
52 const url = new URL(c.req.url);
53 const search = {

sqliteExplorerAppREADME.md1 match

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

dailyStandupBotmain.tsx1 match

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

readwiseHighlightsmain.tsx1 match

@zerovox•Updated 10 months ago
1export async function readwiseHighlights(token: string, ids?: number[]) {
2 let fullData = [];
3 let nextPageCursor = null;

readwiseReaderDocumentListmain.tsx1 match

@zerovox•Updated 10 months ago
24}
25
26export async function readwiseReaderDocumentList(
27 token: string,
28 updatedAfter: string | undefined,

readwiseReaderReadItemsRssmain.tsx3 matches

@zerovox•Updated 10 months ago
2import { readwiseReaderDocumentList } from "https://esm.town/v/zerovox/readwiseReaderDocumentList";
3
4export async function readwiseReaderReadItemsRss() {
5 // Get all of a user's archived documents
6 const archivedData = await readwiseReaderDocumentList(Deno.env.get("readwiseReaderApiToken"), undefined, "archive");
25}
26
27function escapeXml(unsafe) {
28 return unsafe.replace(/[<>&'"]/g, function(c) {
29 switch (c) {
30 case "<":

valTownChatGPTmain.tsx3 matches

@simonw•Updated 10 months ago
13
14const clientCode = () => {
15 document.getElementById("input").addEventListener("submit", async function(event) {
16 event.preventDefault();
17
45 + `&assistantId=${input.getAttribute("data-assistant-id")}`,
46 );
47 eventSource.onmessage = function(event) {
48 console.log(event);
49 responseDiv.innerText += JSON.parse(event.data);
50 };
51
52 eventSource.onerror = function() {
53 eventSource.close();
54 };

heat_at_pointmain.tsx1 match

@l3gacyb3ta•Updated 10 months ago
3const lerp = (a, b, t) => (1 - t) * a + t * b;
4
5function transform(a, b, M, roundToInt = false) {
6 const round = (v) => (roundToInt ? v | 0 : v);
7 return [

exampleTranslationmain.tsx2 matches

@iamseeley•Updated 10 months ago
1import Pipeline from "https://esm.town/v/iamseeley/pipeline";
2
3export default async function handler(req) {
4 if (req.method === "GET") {
5 return new Response(`
16
17 <script>
18 document.getElementById('translationForm').addEventListener('submit', async function(event) {
19 event.preventDefault();
20 const formData = new FormData(this);

exampleFeatureExtractionmain.tsx1 match

@iamseeley•Updated 10 months ago
1import Pipeline from "https://esm.town/v/iamseeley/pipeline";
2
3export default async function handler(req) {
4 if (req.method === "GET") {
5 return new Response(`

getFileEmail4 file matches

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

tuna8 file matches

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