Search

Results include substring matches and semantically similar vals. Learn more
gueejla avatar
strategodotlive
@gueejla
a stratego implementation in a single val!
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
return (
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
function server(req: Request): Promise<Response> {
return new Response(
ZainabMakled avatar
biobankJobDashboard
@ZainabMakled
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function JobDashboard() {
const [jobs, setJobs] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<JobDashboard />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
// Fetch jobs from multiple sources
'https://www.linkedin.com/jobs/search/?keywords=biobank'
async function fetchJobs() {
try {
zebrainy avatar
getAppleDevice
@zebrainy
An interactive, runnable TypeScript val by zebrainy
Express (deprecated)
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
export async function getAppleDevice(req: express.Request, res: express.Response) {
const deviceId = req.query.search_keywords as string;
const html = await fetchText(
user04 avatar
jobboard
@user04
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [jobs, setJobs] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
jobvengalil avatar
emailRandomJoke
@jobvengalil
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
mihalis_koutouvos_nu avatar
emailRandomJoke
@mihalis_koutouvos_nu
// Fetches a random joke.
Cron
// ... imports ...
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
janpaul123 avatar
valle_tmp_23396750916738656242319369935895
@janpaul123
// Response with "Hello World" in crazy CSS and silly gradients
HTTP
// Response with "Hello World" in crazy CSS and silly gradients
export default async function(req: Request): Promise<Response> {
const htmlResponse = `
<!DOCTYPE html>
ronaliuzhong avatar
emailRandomJoke
@ronaliuzhong
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
metart43 avatar
getOctopusEnergyRates
@metart43
// Declare the function as async and export it
HTTP
import process from "node:process";
// Declare the function as async and export it
export const htmlExample = async () => {
const todaysDate = new Date();
// Helper function to format the date
function formatDateForOctopus(date) {
const isoString = date.toISOString();
value: rate.value_inc_vat,
function filterDataForDate(data, date) {
return data.filter((d) => {
artivilla avatar
farcasterKeyHook
@artivilla
FarcasterCustomKeywordHook Simple service notify you your configured keywords on Farcaster to Slack 3 steps: Create a Neynar webhook (https://dev.neynar.com/webhook), via no-code to plug in your forked val URL as their webhook target URL. Add events and keywords you want notified to your slack bot. In the example below, we watch for the text "outpaint". Create a bot to send messages to Slack. https://docs.val.town/integrations/slack/send-messages-to-slack/#_top Add your SLACK_WEBHOOK_URL provided in the step under Val environment variables. https://www.val.town/settings/environment-variables Wait for keyword or Cast in Farcaster with keyword. Will change depending on your event types selected in Step 1-2. Profit 💸💸
HTTP
export default async function server(request: Request): Promise<Response> {
// Check if it's a POST request
if (request.method !== "POST") {
dev_pioneiro avatar
testeExpressEndpoint
@dev_pioneiro
An interactive, runnable TypeScript val by dev_pioneiro
Script
export function testeExpressEndpoint(req: express.Request, res: express.Response) {
console.log("@testeVal.context => ", req.body);
dhvanil avatar
val_wdRvdd0aOO
@dhvanil
An interactive, runnable TypeScript val by dhvanil
Script
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {
pomdtr avatar
testCache
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP
const cache = await caches.open("valtown")
export default async function(req: Request) {
const cached = await cache.match(req)
if (cached) {
bnorick avatar
reddit_alert_example
@bnorick
An interactive, runnable TypeScript val by bnorick
Script
import { check_reddit } from "https://esm.town/v/bnorick/check_reddit";
export async function reddit_alert_example({ lastRunAt }) {
console.log(`last run at ${lastRunAt.getTime() / 1000}`);
return await check_reddit({
adamgonda avatar
moveSnake
@adamgonda
An interactive, runnable TypeScript val by adamgonda
Script
import { moveBody } from "https://esm.town/v/adamgonda/moveBody";
export function moveSnake(state) {
const { snake } = state;
return {