Search
val_WUemzNXhaN
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_WUemzNXhaN(req) {
try {
// to create complex structures - similar to how DNA builds life
function createEmergentPatterns(basePatterns, combinations) {
// Define some basic pattern types (like DNA bases)
D: [0, 1, 1]
// Function to combine patterns and create emergence
function combinePatterns(pat1, pat2) {
return pat1.map((val, idx) => {
![chrislaughlin avatar](https://images.clerk.dev/oauth_github/img_2SSivpG3BmniKiwBIK5HYXGhMyG.jpeg)
myApi
@chrislaughlin
An interactive, runnable TypeScript val by chrislaughlin
Script
export function myApi(name) {
return "hi " + name;
![sntran avatar](https://secure.gravatar.com/avatar/21d666c7857f5b74e7be4195be3a06a7.jpg?s=200&d=identicon)
myApi
@sntran
An interactive, runnable TypeScript val by sntran
Script
export function myApi(name) {
return "hi " + name;
![jndev avatar](https://images.clerk.dev/oauth_github/img_2Snx1ZPH0t8PvgmWBTpJrYuZNWz.jpeg)
myApi
@jndev
An interactive, runnable TypeScript val by jndev
Script
export function myApi(name) {
return "hi " + name;
![steveb1313 avatar](https://images.clerk.dev/oauth_github/img_2ScQNOcM00tE7lUO4C1SNYWjjY4.png)
OfficeJSTest
@steveb1313
An interactive, runnable TypeScript val by steveb1313
Script
export async function OfficeJSTest(
req: express.Request,
res: express.Response,
aqi
@callistus
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 = "crown heights brooklyn"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
myApi
@cmd
An interactive, runnable TypeScript val by cmd
Script
export function myApi(name) {
return "hi " + name;
valle_tmp_63310026100017965110952142769065
@janpaul123
// This val will serve an HTML page emulating a Hacker News clone.
HTTP
// It uses plain HTML and CSS to create the frontend. Eventually,
// we can make it interactive with additional scripts.
export default async function(req: Request): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
umap
@ejfox
UMAP Dimensionality Reduction API This is a high-performance dimensionality reduction microservice using UMAP (Uniform Manifold Approximation and Projection). It provides an efficient way to reduce high-dimensional data to 2D or 3D representations, making it easier to visualize and analyze complex datasets. When to Use This Service Visualizing high-dimensional data in 2D or 3D space Reducing dimensionality of large datasets for machine learning tasks Exploring relationships and clusters in complex data Preprocessing step for other machine learning algorithms Common Use Cases Visualizing word embeddings in a scatterplotcs Exploring customer segmentation in marketing analytics Visualizing image embeddings in computer vision tasks
HTTP
export default async function server(request: Request): Promise<Response> {
<h3>Example with OpenAI Embeddings:</h3>
<p>This example shows how to use the UMAP service with OpenAI embeddings:</p>
// First, generate embeddings using OpenAI API
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
async function getEmbeddings(texts) {
const response = await openai.embeddings.create({
const texts = ["Hello world", "OpenAI is amazing", "UMAP reduces dimensions"];
function runDemo() {
muddyAmethystLimpet
@pdebieamzn
// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
HTTP
// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
// and display them on a big calendar. We'll use react-big-calendar for the calendar component,
const localizer = momentLocalizer(moment);
function App() {
const [events, setEvents] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");
const fullText = await pdfExtractText.default(arrayBuffer);
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
} catch (error) {
console.error('Error parsing OpenAI response:', error);
console.log('Raw response:', completion.choices[0].message.content);
if (!Array.isArray(events)) {
console.error('Unexpected response format from OpenAI');
return new Response(JSON.stringify({ error: 'Unexpected response format' }), { status: 500, headers: { 'Content-Type': 'application/json' } });
orangePiranha
@nethanmadhav
// 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",
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
ssr_react_mini
@stevekrouse
Server-side Render React Mini Framework This is very experimental, more of a prototype of an architecture, than a true framework Example: https://www.val.town/v/stevekrouse/TodoApp
Script
</form>
export const hydrate = (importMetaURL: string) =>
async function(req: Request): Promise<Response> {
const { author, name } = extractValInfo(importMetaURL);
const valURL = `https://www.val.town/v/${author}/${name}`;
safeMessageBoard
@jahabeebs
content-checker is designed to be a modern, open-source library for programmatic and AI content moderation. Currently content-checker supports image and text moderation.
Thanks to LLMs in addition to detecting specific profane words, we can detect malicious intent in text.
So, a user who tries to circumvent the AI profanity filter by using a variation of a profane word, or even just a malicious phrase
without a specific word in the profanity list, will still be flagged. Image moderation is also supported, using the Inception V3 model of the NSFW JS library. Future features will include moderation tools (auto-ban, bots), more powerful models, and multimedia support for video and audio moderation. To get an API key for the AI endpoints sign up free at https://www.openmoderator.com
To install content-checker do npm install content-checker and check out the README: https://github.com/utilityfueled/content-checker
HTTP
<script>
document.addEventListener('DOMContentLoaded', function() {
const form = document.querySelector('form');
form.addEventListener('submit', async function(event) {
event.preventDefault();
newScript.innerHTML = \`
document.addEventListener('DOMContentLoaded', function() {
const form = document.querySelector('form');
form.addEventListener('submit', async function(event) {
event.preventDefault();
checkManualProfanityList: false,
// provider defaults to "google-perspective-api" (Google's Perspective API); it can also be "openai" (OpenAI Moderation API) or "google-natural-language-api" (Google's Natural Language API)
provider: "google-perspective-api",
<script>
document.addEventListener('DOMContentLoaded', function() {
const form = document.querySelector('form');
form.addEventListener('submit', async function(event) {
event.preventDefault();
newScript.innerHTML = \`
document.addEventListener('DOMContentLoaded', function() {
const form = document.querySelector('form');
form.addEventListener('submit', async function(event) {
event.preventDefault();