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=1674&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 20384 results for "function"(3392ms)

renderResumemain.tsx1 match

@iamseeley•Updated 9 months ago
1export function renderResume({
2 resumeDetails,
3 theme,

savePDFmain.tsx2 matches

@iamseeley•Updated 9 months ago
1function applyPDFStyles() {
2 const style = document.createElement('style');
3 style.textContent = `
77}
78
79export function saveAsPDF() {
80 const saveButton = document.getElementById('saveAsPDFButton');
81 if (saveButton) {

neverthrowmain.tsx2 matches

@pomdtr•Updated 9 months ago
9}
10
11export function Success<T>(value: T): Success<T> {
12 return { ok: true, value };
13}
14
15export function Failure<E>(error: E): Failure<E> {
16 return { ok: false, error };
17}

publicBlushSnipemain.tsx2 matches

@pomdtr•Updated 9 months ago
1import { Failure, Success } from "https://esm.town/v/pomdtr/neverthrow";
2
3const demoFunction = () => {
4 const result = Math.random();
5 if (result > 0.5)
10};
11
12const res = demoFunction();
13if (res.success) {
14 console.log(res.data);

neverthrowREADME.md2 matches

@pomdtr•Updated 9 months ago
4import { Failure, Success } from "https://esm.town/v/pomdtr/neverthrow?v=5";
5
6const demoFunction = () => {
7 const result = Math.random();
8 if (result > 0.5) {
14};
15
16const res = demoFunction();
17if (res.ok) {
18 console.log(res.value);

linkInBioTemplatemain.tsx1 match

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

bloodyOliveMolluskmain.tsx2 matches

@mmorihara•Updated 9 months ago
43 `{% if and_or %}{{ and_or }}{% endif %} ${id ? "id = ?" : "" } ${key ? "json_extract(body, '$.${key}') ${predicate} ?" : ""} {% if tree %}AND json_tree.key='{{ key }}' AND {% endif %}json_extract(body, '$.{{ key }}') {{ predicate }} ?{% endif %} {% if tree %}{% if key %}(json_tree.key='{{ key }}' AND {% endif %}json_tree.value {{ predicate }} ?{% if key %}){% endif %}{% endif %}`;
44
45async function executeStatement(statement, args = []) {
46 return await sqlite.execute({
47 sql: statement,
50}
51
52async function init() {
53 await sqlite.batch(schema);
54}

MiauFoodmain.tsx4 matches

@mauriciobc•Updated 9 months ago
14}
15
16export default async function main(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18
104 mdc.autoInit();
105
106 function filterByDate(date) {
107 var parts = date.split('-');
108 var formattedDate = parts[2] + '/' + parts[1] + '/' + parts[0];
110}
111
112 async function deleteEntry(index) {
113 const response = await fetch('/log', {
114 method: 'DELETE',
121 }
122
123 async function clearAll() {
124 if (confirm('Are you sure you want to delete all entries?')) {
125 const response = await fetch('/log', { method: 'DELETE' });

sqlitemain.tsx5 matches

@maxm•Updated 9 months ago
31
32// ------------
33// Functions
34// ------------
35
36async function execute(statement: InStatement): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
48}
49
50async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52 method: "POST",
62}
63
64function createResError(body: string) {
65 try {
66 const e = zLibsqlError.parse(JSON.parse(body));
113 *
114 * The types are currently shown for types declared in a SQL table. For
115 * column types of function calls, for example, an empty string is
116 * returned.
117 */

resumeSetupmain.tsx1 match

@iamseeley•Updated 9 months ago
2import { oceanTheme } from 'https://esm.town/v/iamseeley/oceanTheme';
3
4export async function resumeSetup(resumeConfig) {
5 const {
6 resumeJsonUrl,

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.