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%22Optional%20title%22?q=function&page=1771&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 19901 results for "function"(3554ms)

OpenAIREADME.md2 matches

@pomdtr•Updated 1 year ago
12const openai = new OpenAI();
13
14const functionExpression = await openai.chat.completions.create({
15 "messages": [
16 { "role": "user", "content": "Say hello in a creative way" },
20});
21
22console.log(functionExpression.choices[0].message.content);
23```

preactTestmain.tsx1 match

@neverstew•Updated 1 year ago
4 );
5 const html = htm.bind(h);
6 function Component() {
7 const [count, setCount] = useState(0);
8 const inc = () => setCount(count => count + 1);

exchangeRatemain.tsx1 match

@frontsideair•Updated 1 year ago
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function exchangeRate() {
5 const cheerio = await import("npm:cheerio");
6 const page = await fetch(

generateOncemain.tsx1 match

@easrng•Updated 1 year ago
2import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
3
4export async function generateOnce<S>(fn: () => S | PromiseLike<S>, key): Promise<S> {
5 let value: any = await blob.getJSON(key);
6 if (value) return value;

email_docsmain.tsx1 match

@appan•Updated 1 year ago
12 * The email address(es) to send the email to.
13 * Can be a single string, IAddress object, or an array of strings/IAddress objects.
14 * @default the email of the logged user calling this function.
15 */
16 to?: (IAddress | string)[] | IAddress | string;

readabilityHTTPProxymain.tsx2 matches

@nbbaier•Updated 1 year ago
56};
57
58export default async function(req: Request): Promise<Response> {
59 const JSDOM = jsdom.JSDOM;
60 const url = new URL(req.url);
77
78 <script>
79 document.getElementById('nameForm').onsubmit = function(event) {
80 event.preventDefault();
81 const targetURL = document.getElementById("name").value

sslCertificatesmain.tsx1 match

@agmm•Updated 1 year ago
12};
13
14export async function getCertificates(domain: string) {
15 const url = `https://crt.sh/json?q=${domain}`;
16 const response = await fetch(url);

indigoMockingbirdmain.tsx1 match

@tsoongg•Updated 1 year ago
10});
11// Fetches a random joke.
12async function fetchRandomJoke() {
13 const response = await fetch(
14 "https://official-joke-api.appspot.com/random_joke",

parseBearerStringmain.tsx1 match

@andreterron•Updated 1 year ago
1export function parseBearerString(bearerString: string): string | undefined {
2 if (!bearerString.match(/^Bearer\s+/)) {
3 return undefined;

turquoiseTunamain.tsx1 match

@megansitz•Updated 1 year ago
1function x() {
2 console.log("Welcome to CS1200!");
3}

getFileEmail4 file matches

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

tuna8 file matches

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