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=1&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 14034 results for "function"(515ms)

handlermain.ts1 match

@andrewtwistUpdated 59 mins ago
1export default async function (req: Request): Promise<Response> {
2 if (req.method === "OPTIONS") {
3 return new Response(null, {
1export default async function handler(req: Request): Promise<Response> {
2 const headers = {
3 "Content-Type": "application/json",

Numismatikermain.ts10 matches

@qrtrcgnUpdated 1 hour ago
209];
210
211export default async function (req: Request): Promise<Response> {
212 const html = `
213 <!DOCTYPE html>
436
437 // Tab Navigation
438 window.switchTab = function(tabId) {
439 document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active'));
440 document.querySelectorAll('.tab-btn').forEach(el => el.classList.remove('active'));
450
451 // Katalog rendern
452 function renderCatalog() {
453 const grid = document.getElementById('catalogGrid');
454 grid.innerHTML = '';
506 const tempImages = {};
507
508 window.handleImagePreview = function(event, coinId) {
509 const file = event.target.files[0];
510 const preview = document.getElementById(\`preview-\${coinId}\`);
517
518 const reader = new FileReader();
519 reader.onload = function(e) {
520 const img = new Image();
521 img.onload = function() {
522 const canvas = document.createElement('canvas');
523 const MAX_WIDTH = 300;
545 };
546
547 window.toggleForm = function(coinId) {
548 const form = document.getElementById(\`form-\${coinId}\`);
549 form.classList.toggle('active');
563 };
564
565 window.saveCoin = function(coinId) {
566 const coinData = coinDatabase.find(c => c.id === coinId);
567 const mintEl = document.getElementById(\`mint-\${coinId}\`);
600 };
601
602 window.deleteEntry = function(id) {
603 if(confirm('Eintrag wirklich löschen?')) {
604 collection = collection.filter(item => item.id !== id);
609 };
610
611 function renderCollection() {
612 const list = document.getElementById('collectionList');
613 list.innerHTML = '';
1export default async function handler(req: Request): Promise<Response> {
2 const corsHeaders = {
3 "Access-Control-Allow-Origin": "*",
1export default async function(req: Request): Promise<Response> {
2 const corsHeaders = {
3 "Access-Control-Allow-Origin": "*",

Sciencenew-file-7043.ts21 matches

@jovenisUpdated 1 hour ago
1export default async function (req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html lang="en">
253<script>
254const Q1=[
255 {q:"What is the basic structural and functional unit of the nervous system?",c:["Synapse","Neuron","Axon","Myelin sheath"],a:1,e:"The neuron is the fundamental building block of the nervous system, transmitting electrical and chemical signals throughout the body."},
256 {q:"Which part of a neuron carries impulses AWAY from the cell body?",c:["Dendrite","Nucleus","Axon","Soma"],a:2,e:"Axons carry signals away from the cell body to other neurons or muscles. Dendrites do the opposite — they receive signals and carry them TOWARD the cell body."},
257 {q:"What is the gap between two neurons where signals pass across called?",c:["Axon terminal","Synapse","Myelin gap","Node of Ranvier"],a:1,e:"A synapse is the tiny junction between two neurons. Neurotransmitters cross this gap to pass the signal forward. Nodes of Ranvier are gaps in the myelin sheath, not between cells."},
268 {q:"What is the PNS's main job?",c:["Making memories","Connecting the CNS to limbs and organs","Controlling higher-level thinking","Regulating sleep"],a:1,e:"The PNS links the CNS to the entire body — skin, muscles, and organs — via sensory and motor nerves. Without it, the brain would be isolated."},
269 {q:"A reflex arc bypasses the brain. Which structure processes it?",c:["Cerebellum","Thalamus","Spinal cord","Hypothalamus"],a:2,e:"Reflexes process in the spinal cord — sensory neuron → spinal cord → motor neuron → muscle. Your brain finds out slightly later, hence yanking your hand before feeling pain."},
270 {q:"Which PNS division controls VOLUNTARY movements?",c:["Autonomic NS","Somatic NS","Parasympathetic division","Enteric NS"],a:1,e:"The somatic NS controls conscious, voluntary movements of skeletal muscles. The autonomic NS controls involuntary functions like digestion and heartbeat."},
271 {q:"The 'fight-or-flight' response is triggered by which autonomic division?",c:["Somatic","Parasympathetic","Sympathetic","Central"],a:2,e:"The sympathetic division activates fight-or-flight: faster heartbeat, dilated pupils, slowed digestion, more blood to muscles. The parasympathetic division reverses this ('rest and digest')."},
272 {q:"After a meal, which autonomic division is most active?",c:["Sympathetic","Somatic","Parasympathetic","Central"],a:2,e:"The parasympathetic ('rest and digest') division slows the heart, increases digestive activity, and conserves energy after meals."},
308 {q:"Why do neurons die quickly during a stroke?",c:["They overheat","They need constant oxygen and glucose from blood","Blood pressure compresses the brain","Immune cells attack neurons"],a:1,e:"Neurons cannot store glucose or use anaerobic respiration for long. Without blood flow, neurons begin dying in minutes — every minute of stroke kills ~1.9 million neurons."},
309 {q:"Which condition causes recurrent seizures from abnormal brain electrical activity?",c:["Parkinson's","Epilepsy","Meningitis","Huntington's"],a:1,e:"Epilepsy causes recurrent, uncontrolled synchronized electrical discharges. Seizures vary from convulsions to staring spells depending on brain area involved."},
310 {q:"What is neuroplasticity?",c:["Repairing broken myelin","The brain's ability to reorganize and form new connections throughout life","Neurons converting glucose to energy","CSF movement through ventricles"],a:1,e:"Neuroplasticity allows the brain to rewire in response to learning, experience, and injury. After a stroke, healthy areas can take over damaged functions."},
311 {q:"When does the highest rate of synapse formation (synaptogenesis) occur?",c:["Adolescence","Early childhood (birth–age 3)","Middle age","Late adulthood"],a:1,e:"The first 3 years of life see explosive synapse formation — the brain overproduces synapses, then prunes unused ones. By age 2, a child has roughly twice as many synapses as an adult."},
312 {q:"Synaptic pruning — major wave occurs when?",c:["Neurons cut axons in old age","Eliminating unused synapses — major wave during adolescence","Glia add synapses during sleep","Myelination of axons in adulthood"],a:1,e:"Major pruning occurs in adolescence, especially in the prefrontal cortex, explaining why teenagers can struggle with impulse control and long-term planning."},
317 {q:"During which sleep stage do most vivid dreams occur?",c:["Deep slow-wave sleep","REM sleep; coordinated by the brainstem/pons","Stage 1; thalamus","Stage 3; occipital lobe"],a:1,e:"During REM, the brain is nearly as active as when awake. The pons coordinates rapid eye movements. The brainstem also temporarily paralyzes voluntary muscles during REM."},
318 {q:"How does caffeine counteract sleepiness?",c:["Destroys adenosine molecules","Blocks adenosine receptors so adenosine can't signal sleepiness","Speeds up adenosine production","Activates the sympathetic system"],a:1,e:"Adenosine accumulates while awake and causes drowsiness. Caffeine blocks its receptors. When caffeine wears off, built-up adenosine floods the receptors — causing the energy 'crash.'"},
319 {q:"The amygdala is most important for:",c:["Regulating breathing","Processing emotions especially fear, and tagging memories emotionally","Producing CSF","Controlling finger movements"],a:1,e:"The amygdala evaluates threats and triggers fear responses. It tags memories with emotional significance — overactive amygdala function is linked to anxiety and PTSD."},
320 {q:"What are the three meningeal layers?",c:["Fluid, bone, membrane","Dura mater, arachnoid mater, pia mater","Cortex, subcortex, brainstem","Endosteum, periosteum, synovium"],a:1,e:"Dura mater (tough outer), arachnoid mater (with CSF-filled subarachnoid space), pia mater (delicate inner). Meningitis is dangerous inflammation of these layers."},
321 {q:"Why does the cerebral cortex have so many folds (gyri)?",c:["Folds slow transmission","Folding dramatically increases surface area within the skull","Folds separate brain lobes","Folds increase blood flow only"],a:0,e:"Gyri (ridges) and sulci (grooves) allow ~2.5 sq ft of cortical surface to fit in the skull — more surface area means more neurons and more processing power."},
348 {q:"A PET scan identifies active brain areas using:",c:["Magnetic fields","X-ray attenuation","Radioactive glucose tracers that accumulate in active neurons","Sound wave reflections"],a:2,e:"PET injects radioactive glucose (FDG) — active neurons consume more, accumulating the tracer which emits detectable gamma rays. Also used to detect tumors and Alzheimer's amyloid plaques."},
349 {q:"What is the default mode network (DMN)?",c:["Circuit controlling basic reflexes","Brain regions active during mind-wandering and self-reflection — deactivated during focused tasks","Motor cortex to spinal cord pathway","Visual pathway from retina to occipital cortex"],a:1,e:"The DMN activates during mind-wandering, daydreaming, and thinking about others. It deactivates during focused tasks. DMN disruption occurs in Alzheimer's, schizophrenia, and autism."},
350 {q:"What is the limbic system's overall role?",c:["Processing pain only","Structures involved in emotion, motivation, and memory formation","All involuntary body functions","Regulating sleep only"],a:1,e:"The limbic system integrates emotion (amygdala), memory formation (hippocampus), basic drives (hypothalamus), and attention (cingulate gyrus). Many psychiatric conditions involve limbic dysfunction."},
351 {q:"Mirror neurons fire when you:",c:["Only when you act yourself","Both when you act AND when you watch someone else do the same action","Only during visual object processing","Only during language production"],a:1,e:"Mirror neurons are thought to underlie imitation learning and empathy. They may contribute to social communication, and disrupted mirror neuron function has been hypothesized in autism spectrum disorder."},
352 {q:"Atropine blocks muscarinic ACh receptors. Its effect on the heart is:",c:["Slows heart by mimicking parasympathetic input","Speeds up heart by blocking parasympathetic slowing","No effect on heart rate","Directly stimulates sympathetic nerves"],a:1,e:"The parasympathetic system normally slows the heart via ACh. Atropine blocks this braking — heart speeds up. Used in emergencies for dangerous bradycardia and to dilate pupils for eye exams."},
353 {q:"Beta-blockers work by:",c:["Enhancing GABA to calm the brain","Blocking beta-adrenergic receptors, reducing adrenaline's effects","Destroying norepinephrine","Inhibiting the parasympathetic NS"],a:1,e:"Beta-blockers reduce heart rate, blood pressure, and physical fight-or-flight symptoms (shaky hands, racing heart). Musicians sometimes use them off-label for performance anxiety."},
356 {q:"The HPA stress axis final hormone output is:",c:["Insulin","Cortisol from the adrenal cortex","Aldosterone","Growth hormone"],a:1,e:"HPA axis: hypothalamus (CRH) → anterior pituitary (ACTH) → adrenal cortex (cortisol). Cortisol mobilizes energy and suppresses immunity. Cortisol feedback turns the axis off."},
357 {q:"Broca's vs. Wernicke's area: what is the difference?",c:["Both do the same thing","Broca's (frontal) produces speech; Wernicke's (temporal) comprehends language","Broca's processes hearing; Wernicke's processes vision","Active only during reading"],a:1,e:"Broca's aphasia: understands but speaks in halting telegraphic sentences. Wernicke's aphasia: speaks fluently but produces meaningless word salad and cannot understand speech."},
358 {q:"The arcuate fasciculus connects Broca's to Wernicke's area. Damage causes:",c:["Loss of motor function","Conduction aphasia — can speak and understand but cannot repeat what they hear","Complete mutism","Blindness"],a:1,e:"Conduction aphasia from arcuate fasciculus damage shows that speech production and comprehension depend on distinct, connected circuits — not just one language area."},
359 {q:"In most right-handed people, language is lateralized to:",c:["Equally distributed","Right hemisphere","Left hemisphere","Cerebellum"],a:2,e:"~95% of right-handed people have language in the LEFT hemisphere (Broca's and Wernicke's areas). Right hemisphere specializes in prosody, spatial processing, and music."},
360 {q:"What is the difference between ischemic and hemorrhagic stroke?",c:["They are identical","Ischemic = clot blocks a vessel; hemorrhagic = vessel ruptures","Hemorrhagic only affects spinal cord","Ischemic only affects brainstem"],a:1,e:"~87% of strokes are ischemic (blood clots). Hemorrhagic strokes are caused by vessel rupture. Treatments differ critically: clot-busting tPA helps ischemic but would worsen hemorrhagic stroke."},
375
376const SCREENS=['s0','sq','sr1','si2','sr2','si3','sr3'];
377function hide(){SCREENS.forEach(id=>document.getElementById(id).classList.add('hidden'))}
378
379function home(){
380 clearInterval(tmrId);
381 document.body.className='';
386}
387
388function intro(r){
389 clearInterval(tmrId);
390 hide();
395}
396
397function setHdr(r){
398 const b={1:'Science Olympiad · Division A · 2025–2026',2:'Science Olympiad · Round 2 · Advanced',3:'Science Olympiad · Round 3 · Expert'};
399 const t={1:'Nervous System<br>Challenge',2:'Nervous System<br>Round 2',3:'Nervous System<br>Round 3'};
404}
405
406function go(r){
407 rnd=r;
408 qs=shuf(r===1?[...Q1]:r===2?[...Q2]:[...Q3]);
416}
417
418function restart(){go(rnd)}
419
420function startTmr(){
421 clearInterval(tmrId);
422 tmrId=setInterval(()=>{
427}
428
429function updTmr(){
430 const m=Math.floor(sLeft/60),s=sLeft%60;
431 const el=document.getElementById('tmr');
434}
435
436function render(){
437 ans=false;
438 const q=qs[cQ],tot=qs.length,lbl='Q '+(cQ+1)+' of '+tot;
456}
457
458function pick(i){
459 if(ans)return;
460 ans=true;
476}
477
478function next(){
479 cQ++;
480 if(cQ>=qs.length)finish();
482}
483
484function finish(){
485 clearInterval(tmrId);
486 const m=Math.floor(sLeft/60),s=sLeft%60;
507}
508
509function shuf(a){
510 for(let i=a.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[a[i],a[j]]=[a[j],a[i]]}
511 return a;

untitled-5254main.ts1 match

@wenderaugusto15Updated 1 hour ago
1export default async function (req: Request): Promise<Response> {
2 const corsHeaders = {
3 "Access-Control-Allow-Origin": "*",

my-first-valcommuter_proxy.ts1 match

@ktreillyUpdated 1 hour ago
1export default async function (req: Request): Promise<Response> {
2 let display_man = "SERVICE CHANGE", display_qns = "SERVICE CHANGE";
3 let weather = { temp: "--", rain: "0%", wind: "--mph", cond: "..." };
1export default async function handler(req: Request): Promise<Response> {
2 const corsHeaders = {
3 "Access-Control-Allow-Origin": "*",

untitled-619main.ts10 matches

@zyloxtubeUpdated 2 hours ago
7
8// ==================== دوال التشفير (بدون تغيير) ====================
9async function loadForge() {
10 const forge = await import("npm:node-forge@1.3.1");
11 return forge.default || forge;
12}
13
14function encryptPassword(
15 plainText: string,
16 publicKeyPem: string,
39}
40
41function generatePassword(): string {
42 const chars = [];
43 for (let i = 0; i < 8; i++) {
47}
48
49function generateEmail(): string {
50 const chars = [];
51 for (let i = 0; i < 14; i++) {
56
57// ==================== إنشاء حساب جديد ====================
58async function createNewAccount() {
59 console.log("📋 جلب التذكرة...");
60
164
165// ==================== إنشاء الهيدرز ====================
166function createHeaders(account: any) {
167 const cookieString = account.cookies.map((c: string) => c.split(";")[0]).join(
168 "; ",
182
183// ==================== استخراج رابط الصورة ====================
184function extractImageUrl(result: string): string | null {
185 if (!result) return null;
186
217
218// ==================== تحويل الصورة إلى فريمات باستخدام PNG.js (بدون مشاكل SSL) ====================
219async function downloadImageAsBuffer(url: string): Promise<Buffer> {
220 console.log("📥 تحميل الصورة...");
221
284}
285
286async function imageToFrames(imageUrl: string) {
287 console.log("🖼️ تحويل الصورة إلى فريمات...");
288
365
366// ==================== توليد الصورة وتحويلها إلى فريمات ====================
367async function generateImage(
368 prompt: string,
369 imageSize?: string,

az_referral_codes_query1 file match

@vinciartsUpdated 1 week ago
Query referral codes via user/queries functions

az_referral_hunt1 file match

@vinciartsUpdated 1 week ago
Hunt for referral code function names across all JS chunks