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/$%7Burl%7D?q=function&page=2412&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 27812 results for "function"(7235ms)

aqimain.tsx1 match

@mykalattinybox•Updated 9 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "abbotsford, british columbia"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

pollRSSFeedsmain.tsx1 match

@kutay25•Updated 9 months ago
3import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds";
4
5export async function pollRSSFeeds({ lastRunAt }: Interval) {
6 return Promise.all(
7 Object.entries(rssFeeds).map(async ([name, url]) => {

stuckIvoryParakeetREADME.md1 match

@jamisonl•Updated 9 months ago
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality

hnmain.tsx3 matches

@maxm•Updated 9 months ago
16`);
17
18function createErrorPage(title: string, message: string): string {
19 return `
20 <html>
108};
109
110function injectNotificationIndicator(html: string): string {
111 const notificationCount = 21; // Hardcoded for now
112 const notificationIndicator = `
125}
126
127export default async function(req: Request): Promise<Response> {
128 const url = new URL(req.url);
129 let userCookie: string | undefined;

sqliteExplorerAppREADME.md1 match

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

emailmain.tsx1 match

@shouser•Updated 9 months ago
12 * The email address(es) to send the email to. Only available to Val Town Pro subscribers.
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;

reluctantCoffeeGayalmain.tsx10 matches

@kaz•Updated 9 months ago
28 "Have the ability to murder anyone without any consequences",
29 "Have a tight knit and loyal friend group",
30 "Have another set of eyes in the back of your head (they are fully functional)",
31 "Have a very physically attractive romantic partner",
32 "Be able to spawn pizzas by snapping your fingers (max 2 per 12 hours)",
36];
37
38function App() {
39 const [user, setUser] = useState<User | null>(null);
40 const [answers, setAnswers] = useState<Answer[]>([]);
106}
107
108function SplashScreen({ onGetStarted }: { onGetStarted: () => void }) {
109 return (
110 <div className="splash-screen">
132}
133
134function TabBar() {
135 const location = useLocation();
136 const tabs = [
163}
164
165function Game({ user, saveAnswer }: { user: User | null; saveAnswer: (answer: Answer, losingAnswer: string) => void }) {
166 const getRandomQuestion = useCallback((): Question => {
167 const availableOptions = [...ANSWER_OPTIONS];
198}
199
200function Answers(
201 { user, answers, rankings, clearAnswers }: {
202 user: User | null;
237}
238
239function Profile({ user, setUser }: { user: User | null; setUser: (user: User | null) => void }) {
240 const [username, setUsername] = useState("");
241
277}
278
279function client() {
280 createRoot(document.getElementById("root")!).render(<App />);
281}
285}
286
287async function server(request: Request): Promise<Response> {
288 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
289 const KEY = "reluctantCoffeeGayal";
369}
370
371async function updateEloRankings(sqlite: any, KEY: string, winningAnswer: string, losingAnswer: string) {
372 const K = 32; // This is the maximum score change per match
373

fancyPlumSquirrelmain.tsx3 matches

@cofsana•Updated 9 months ago
9import { createRoot } from "https://esm.sh/react-dom/client";
10
11function App() {
12 const [panelMembers, setPanelMembers] = useState([]);
13 const [newMember, setNewMember] = useState({ name: "", expertise: "" });
116}
117
118function client() {
119 createRoot(document.getElementById("root")).render(<App />);
120}
124}
125
126async function server(request: Request): Promise<Response> {
127 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
128 const KEY = "fancyPlumSquirrel";

TufteCSSmain.tsx3 matches

@all•Updated 9 months ago
10import { createRoot } from "https://esm.sh/react-dom/client";
11
12function App() {
13 const [layoutType, setLayoutType] = useState('flexbox');
14 const [flexDirection, setFlexDirection] = useState('row');
126}
127
128function client() {
129 createRoot(document.getElementById("root")).render(<App />);
130}
134}
135
136export default async function server(request: Request): Promise<Response> {
137 return new Response(
138 `

litepickbetmain.tsx5 matches

@cyrilos•Updated 9 months ago
296 /* events */
297
298 /* run function on win */
299 onWin(func) {
300 this.winHandlers.push(func);
301 }
302
303 /* run function on loss */
304 onLoss(func) {
305 this.lossHandlers.push(func);
306 }
307
308 /* run function on every bet */
309 onBet(func) {
310 this.betHandlers.push(func);
323/* main app */
324
325async function loop() {
326 var url = "https://cyrilos-litepickbet.web.val.run";
327 await axios({
332
333/* bet session */
334async function playDice() {
335 const PLATFORM = "litepick.io";
336 const cookies = await blob.getJSON("cookies");

getFileEmail4 file matches

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

tuna8 file matches

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