Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
githubNotification
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Cron
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
import { email } from "https://esm.town/v/std/email?v=11";
export async function githubNotification({ lastRunAt }) {
let events = (
await fetchJSON(
muhammad_owais_warsi avatar
shySapphireLeopard
@muhammad_owais_warsi
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const links = [
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
return new Response(
steveb1313 avatar
spellCheckTest
@steveb1313
An interactive, runnable TypeScript val by steveb1313
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function spellCheckTest(
req: express.Request,
<h3>Description: ${spell["desc"][0]}</h3>
<button onclick="myFunction()">Reveal Spell</button><br>
<div id="myDIV"></div>
<script>
function myFunction() {
var x = document.getElementById("myDIV");
janpaul123 avatar
valle_tmp_83196770112294164325323251044431
@janpaul123
// This val responds with "Hello World" styled with crazy gradients in CSS
HTTP
// This val responds with "Hello World" styled with crazy gradients in CSS
export default async function main(req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
stevekrouse avatar
seamlessBlushSwallow
@stevekrouse
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function debounce(func: Function, wait: number) {
let timeout: number | undefined;
return function executedFunction(...args: any[]) {
const later = () => {
timeout = setTimeout(later, wait);
function App() {
const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
}, [code, debouncedRenderShader]);
async function handleSubmit(e: React.FormEvent) {
e.preventDefault();
</div>
function client() {
createRoot(document.getElementById("root")!).render(<App />);
client();
function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
const gl = canvas.getContext("webgl");
gl_Position = a_position;
function createShader(gl: WebGLRenderingContext, type: number, source: string) {
const shader = gl.createShader(type);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
function extractGLSLCode(text: string): string {
const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
: text.trim();
export default async function server(req: Request): Promise<Response> {
if (req.method === "POST") {
dhvanil avatar
val_6mHf5OkPYV
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function findLowestThreeDigitFibonacci() { let a = 0, b = 1; let lowestThreeDigit; while (b < 1000) { let temp =
findLowestThreeDigitFibonacci();
return Response.json({ success: true, result });
lpoulter avatar
valTownDailyInspo
@lpoulter
An interactive, runnable TypeScript val by lpoulter
Script
import { valTownInspirationEmail } from "https://esm.town/v/rodrigotello/valTownInspirationEmail?v=79";
export async function valTownDailyInspo() {
return await valTownInspirationEmail();
fgeierst avatar
getMunichSwimCapacit
@fgeierst
An interactive, runnable TypeScript val by fgeierst
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function getMunichSwimCapacit() {
const organizationUnitIds = [
{ id: 30200, name: "Dantebad Sauna" },
async function fetchCount(id) {
const endpoint =
`https://functions.api.ticos-systems.cloud/api/gates/counter?organizationUnitIds=${id}`;
const response = await fetch(endpoint, {
return { id, personCount, maxPersonCount };
async function populateUnits() {
for (let unit of organizationUnitIds) {
mur avatar
snakeGameComplete
@mur
werkend
HTTP
panelsInterested: number
function calculatePrepaidCompoundInvestmentReturns(config: InvestmentPackage) {
const totalCustomerPrice = config.panelCount * config.customerPricePerPanel
savingsComparedToMarket: totalMarketPrice - totalCustomerPrice,
function InvestmentSliders({
config,
</div>
function CompoundInvestmentTable({
monthlyReturns,
</div>
function App() {
const TOTAL_SPOTS = 50;
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
rebelpotato avatar
watch_bilibili_video
@rebelpotato
// watch a bilibili video for a random time less than its duration
Script
import { post_bilibili } from "./bilibili_methods";
function randint(x) {
return Math.floor(Math.random() * x);
const watch_video_url = "http://api.bilibili.com/x/v2/history/report";
// watch a bilibili video for a random time less than its duration
export async function watch_video(video, cookie) {
let watch_video_data = {
aid: video.aid,
paulsun avatar
parkingSpots
@paulsun
An interactive, runnable TypeScript val by paulsun
Script
import { fetch } from "https://esm.town/v/std/fetch";
export function parkingSpots(lat, lng, radius = 5) {
return fetch(
`https://park4night.com/api/places/around?lat=${lat}&lng=${lng}&radius=${radius}&filter=%7B%7D&lang=en`
sourishkrout avatar
getRunmeTotals
@sourishkrout
An interactive, runnable TypeScript val by sourishkrout
Script
import { githubStars } from "https://esm.town/v/sourishkrout/githubStars";
export async function getRunmeTotals(bearer?: string): Promise<number> {
return (await Promise.all(
[["stateful", "runme"], ["stateful", "vscode-runme"]].map(([h, r]) => githubStars(h, r, bearer)),
tarunxsh avatar
aqi
@tarunxsh
AQI Alerts Get email alerts when AQI is unhealthy near you. Set up Click Fork Change location (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API . Click Run Background This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
Cron
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
export async function aqi(interval: Interval) {
const location = "delhi, india"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
mikehiggins avatar
tfidf_analyser_90s_version
@mikehiggins
// Expanded stopwords list
HTTP
// Function to calculate TF-IDF
function calculateTFIDF(text, outputSize = 7) {
// Function to calculate word frequency
function calculateWordFrequency(text, topN = 30) {
// Function to generate a fun fact
function generateFunFact(text) {
// Function to perform simple sentiment analysis
function analyseSentiment(text) {
// Function to generate a simple summary
function generateSummary(text, sentenceCount = 3) {
janpaul123 avatar
valle_tmp_68349873444339632722229399189495
@janpaul123
// This val responds with "Hello World" to all incoming HTTP requests with crazy CSS gradients
HTTP
// This val responds with "Hello World" to all incoming HTTP requests with crazy CSS gradients
export default async function main(req: Request): Promise<Response> {
const css = `
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);