Search
FigmaColorsAsArrayTest
@rodrigotello
An interactive, runnable TypeScript val by rodrigotello
Script
import { FigmaFileObject } from "https://esm.town/v/rodrigotello/FigmaFileObject";
import { FigmaColorsRGB } from "https://esm.town/v/rodrigotello/FigmaColorsRGB";
export const FigmaColorsAsArrayTest = FigmaColorsRGB(
FigmaFileObject,
hnPoll
@varela
An interactive, runnable TypeScript val by varela
Script
let { hnLastChecked } = await import("https://esm.town/v/varela/hnLastChecked");
import { hnSearch } from "https://esm.town/v/stevekrouse/hnSearch?v=16";
export let hnPoll = async () => {
let results = await hnSearch({
query: "clojure",
numericFilters: `created_at_i>${hnLastChecked}`,
results?.hits?.forEach(console.email);
hnLastChecked = Date.now() / 1000;
console.log(`${results?.length || 0} results from HN`);
sqlite_explorer
@burcs
An interactive, runnable TypeScript val by burcs
HTTP (deprecated)
export { default } from "https://esm.town/v/nbbaier/sqliteExplorerApp?v=86";
fetchDateMeProfiles
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export const fetchDateMeProfiles = () =>
fetchTable(
dateMeURL,
) as Promise<{
"Name": string;
"Profile": {
"text": string;
"href": string;
"Gender": ("F" | "M" | "NF") | ("F" | "M" | "NF")[];
"Interested In"?: ("F" | "M" | "NF") | ("F" | "M" | "NF")[];
name
@mountainbed
An interactive, runnable TypeScript val by mountainbed
Script
export let name = "RossTheBoss";
reportCommentNotification
@parkerdavis
An interactive, runnable TypeScript val by parkerdavis
HTTP (deprecated)
const DELETE_COMMENT_SECRET = Deno.env.get("DELETE_COMMENT_SECRET");
const baseUrl = "agave-astro.netlify.app";
export default async function(req: Request): Promise<Response> {
if (req.method === "POST") {
const comment = await req.json() as Comment;
console.log("comment", comment);
const fullUrl =
`https://${baseUrl}/api/comments/commentManager?secret=${DELETE_COMMENT_SECRET}&commentId=${comment.id}`;
const modifiedBody = comment.body.replaceAll("\n", "<br>");
await email({
warnings
@nws
Starting with just a few so please email * nws@jordanreger.com if you want more
Script
export class Warnings {
endpoint: string
constructor(api: API) {
this.endpoint = api.url + `/alerts/active?status=actual&event=`;
async latest(warning_type: WarningType): Promise<Warning> {
const features = await fetch(this.endpoint + warning_type + " Warning&limit=1").then(res => res.json())
.then(res => res.features);
if (features.length === 0) return {
type: warning_type,
headline: `No current ${warning_type} warnings`
cachedResponseExample
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export const cachedResponseExample = () => {
return new Response(Date.now(), {
headers: {
"Cache-Control": "public, immutable, max-age=64800",
dotShortcut
@pomdtr
Dot Shortcut This val adds a github-like dot shortcut to your website, redirecting to the val.town edit. Usage Add the following script tag to your website head. <script type="module" src="https://esm.town/v/pomdtr/dotShortcut"></script>
Script
# Dot Shortcut
This val adds a github-like dot shortcut to your website, redirecting to the val.town edit.
## Usage
Add the following script tag to your website head.
```html
<script type="module" src="https://esm.town/v/pomdtr/dotShortcut"></script>
document.addEventListener("keydown", async (event) => {
if (event.key != ".") {
return;
if (document.activeElement != document.body) {
apiExample
@phelan
An interactive, runnable TypeScript val by phelan
Script
import { runVal } from "https://esm.town/v/std/runVal";
export const apiExample = runVal("patrickjm.gpt3", {
prompt: "write me a poem about tralee",
AlgoliaDocumentaion
@willthereader
An interactive, runnable TypeScript val by willthereader
Script
Getting started guide for new local environment
Formatting may be inconsistent from source.
Install InstantSearch
Our InstantSearch library helps provide you with a search experience out of the box. Select your preferred front-end framework to begin designing your search
InstantSearch.js
Create InstantSearch application
Use create-instantsearch-app to create an example search experience with your data
npx create-instantsearch-app@latest instantsearch-app \
--name 'instantsearch-app' \
--template 'InstantSearch.js' \
aqi
@ari
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
# AQI Alerts
Get email alerts when AQI is unhealthy near you.
![](https://i.imgur.com/hB56X7o.png)
## Set up
1. Click `Fork`
2. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
export async function aqi(interval: Interval) {
const location = "waterford connecticut"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
if (!interval.lastRunAt) {
bskyPosts
@sco
// Use this to get the Bluesky posts from any user.
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
// Use this to get the Bluesky posts from any user.
// Just pass in their username (like "vgr.bsky.social")
export const bskyPosts = async (repo = "scottraymond.com") => {
const { records } = await fetchJSON(
`https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${repo}&collection=app.bsky.feed.post`
return records;
test_dlock
@karfau
An interactive, runnable TypeScript val by karfau
Script
export const test_dlock = await testRunner(
val: ["karfau", "dlock"],
dlock: dlock2,
get deadline() {
return Math.floor(Date.now() / 1000 + 1);
id: mainReference(({ userHandle, valName }) =>
`val_town-${userHandle}-${valName}`
ttl: 1,
fetchStub:
(data = {}, { status = 200, ok = status < 400 } = {}) => async () =>
cors_proxy
@adrienj
curl 'https://taras-free_open_router.web.val.run/api/v1/chat/completions' \
-H 'accept: application/json' \
-H 'authorization: Bearer THIS_IS_OVERRIDEN_ON_SERVER' \
-H 'content-type: application/json' \
--data-raw '{
"model": "auto",
"temperature": 0,
"messages": [
{
"role": "system",
"content": "stuff"
},
{
"role": "user",
"content": "hello"
}
],
"stream": true
}'
HTTP (deprecated)
curl 'https://taras-free_open_router.web.val.run/api/v1/chat/completions' \
-H 'accept: application/json' \
-H 'authorization: Bearer THIS_IS_OVERRIDEN_ON_SERVER' \
-H 'content-type: application/json' \
--data-raw '{
"model": "auto",
// Define a common set of CORS headers
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",