Search

Results include substring matches and semantically similar vals. Learn more
scottxxx666 avatar
test
@scottxxx666
An interactive, runnable TypeScript val by scottxxx666
Script
export function test() {
console.email("message", "Subject Line");
andreterron avatar
tidbytStar
@andreterron
An interactive, runnable TypeScript val by andreterron
Script
export async function tidbytStar({ size = 7, bg = 0x047857ff, star = 0xffffffff }: {
size?: number;
bg?: number;
star?: number;
const star2 = 0xfef9c3ff;
const star3 = 0xfef08aff;
const white = 0xffffffff;
const border = 0xeab308ff;
const img = await tidbytCircle({
size,
janpaul123 avatar
valle_tmp_36549593302312316221638155580223
@janpaul123
// This val serves an HTML page with an input field to enter a name. Upon form submission, it greets the user with the entered name.
HTTP (deprecated)
// This val serves an HTML page with an input field to enter a name. Upon form submission, it greets the user with the entere
// We'll handle the form submission using a POST request.
export default async function(req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Greetings Form</title>
raunakdoesdev avatar
myApi
@raunakdoesdev
An interactive, runnable TypeScript val by raunakdoesdev
Script
export function myApi(name) {
return "hi " + name;
tmcw avatar
intervalMonitor
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export let intervalMonitor = (req, res) => {
res.json({ lastIntervalCheck: 100 });
rwev avatar
jupiterPerpetuals
@rwev
// const wallet = Deno.env.get("CRYPTO_ADDR_SOL");
HTTP (deprecated)
import { email } from "https://esm.town/v/std/email";
// const wallet = Deno.env.get("CRYPTO_ADDR_SOL");
// const rows = await getJupiterPerpsPnLForWallet(wallet);
export async function handleJupPerpsRequest(req: Request) {
const wallet = parseUrlParam(req, "w");
console.log(wallet);
return Response.json(
await getJupiterPerpsPnLForWallet(wallet),
rafter avatar
cityLookup
@rafter
// Cities named Brooklyn
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
// Cities named Brooklyn
export let cityLookup = fetchJSON(
"https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
rodrigotellovaltown avatar
consoleEmailEx
@rodrigotellovaltown
// email yourself as easily as logging to the console
Script
// email yourself as easily as logging to the console
export let consoleEmailEx = (() => {
console.email("message"); // any JSON object can be the message
console.email({ html: "<h1>hello html emails!</h1>" }); // you can send HTML emails
console.email({ hi: "there" }, "Subject Line"); // optional second arg is the subject line
console.email({ html: "<b>hi!</b>", subject: "Subject accepted here too" });
// Forked from @felipesabino.consoleEmailEx
stevekrouse avatar
webhook
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export let webhook = (req, res) => {
console.log(Object.getOwnPropertyNames(req))
res.json({a : 'hi'})
andreterron avatar
d
@andreterron
An interactive, runnable TypeScript val by andreterron
Script
export let d = 2
zkoch avatar
bob
@zkoch
An interactive, runnable TypeScript val by zkoch
Script
export let bob = ["hi", "bob"];
jamiedubs avatar
simpleJsonReply
@jamiedubs
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
Express
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
export async function expressHTMLExample(
req: express.Request,
res: express.Response,
const name = req.query.name || req.body.name;
if (!name) return res.json({ error: "must specify ?name or POST similar as JSON" });
const json = { hi: { foo: name } };
return res.json(json);
vtdocs avatar
getGithubUserViaOctokit
@vtdocs
An interactive, runnable TypeScript val by vtdocs
Script
export const getGithubUserViaOctokit = async (username: string) => {
const { Octokit } = await import("npm:@octokit/core");
const octokit = new Octokit();
const user = await octokit.request("GET /users/{username}", {
username,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
return user;
nbbaier avatar
kysely_valgen_POC
@nbbaier
An interactive, runnable TypeScript val by nbbaier
Script
async function generateKyselyTypes(tables: string[]): Promise<string> {
const { author } = await extractValInfo(import.meta.url);
try {
const types = await fetchText(
`https://${author}-kyselyVtTypes.web.val.run/?allowTables=true&tables=${tables.map(t => t.trim()).join(",")}`,
return types;
catch (error) {
console.log(error);
export async function createKyselyTypesVal(
tables: string[],
stevekrouse avatar
zwjEmoji
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
const EMOJI_DATA_URL = "https://unicode.org/Public/emoji/15.1/emoji-zwj-sequences.txt";
export async function getCompoundEmojis(): Promise<string[]> {
const data = await fetchText(EMOJI_DATA_URL);
let result: string[] = [];
const lines = data.split("\n");
for (const line of lines) {
if (line.startsWith("#") || line.trim() === "") continue;
const parts = line.split(";");
if (parts.length < 2) continue;
const codepoints = parts[0].trim().split(" ");