Search
myApi
@ayrtonlacerda
An interactive, runnable TypeScript val by ayrtonlacerda
Script
export function myApi(req, res: express.Response) {
return Response.json({ ok: true });
val_9dy3yd3x6A
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_9dy3yd3x6A(req) {
try {
const body = await req.text();
// Create a function from the provided code and execute it
const userFunction = async () => {
const findPrimes = (n) => {
// Execute and capture the result
const result = await userFunction();
// Handle different types of results
myApi
@sander
An interactive, runnable TypeScript val by sander
Script
export function myApi(name) {
return "hi " + name;
val_h71QOVqMsf
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_h71QOVqMsf(req) {
try {
const body = await req.text();
// Create a function from the provided code and execute it
const userFunction = async () => {
const findPrimes = (n) => {
// Execute and capture the result
const result = await userFunction();
// Handle different types of results
myApi
@irreal
An interactive, runnable TypeScript val by irreal
Script
export function myApi(name) {
console.email("yay " + name);
return "hi :)" + name;
val_kU5QVhf3AL
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_kU5QVhf3AL(req) {
try {
// Execute the code directly and capture its result
// Advanced exploit of precision glitch - testing value manipulation
const precisionExploitAdvanced = () => {
// Function to force value transitions
const forceTransition = (start, end, steps = 10) => {
let results = [];
val_iSvZEYBUrN
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_iSvZEYBUrN(req) {
try {
// Execute the code directly and capture its result
testing
@samhashemi
// import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
HTTP
// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
// { headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` } },
// export function handler(request: Request) {
// let elements = fetchJSON(
// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
// console.log(elements);
// return Response.json({});
export default async function(req: Request): Promise<Response> {
return fetch(
"https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
myApi
@thejackobrien
An interactive, runnable TypeScript val by thejackobrien
Script
export function myApi(name) {
return "hi " + name;
myApi
@cganoo
An interactive, runnable TypeScript val by cganoo
Script
export function myApi(name) {
return "hi " + name;
val_uX5r1pQ5YN
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_uX5r1pQ5YN(req) {
try {
// Execute the code directly and capture its result
myApi
@fshi7418
An interactive, runnable TypeScript val by fshi7418
Script
export function myApi(name) {
return "hi " + name;
nominatimSearch
@stevekrouse
Geocode a free-form description via the Nominatim API The search API allows you to look up a location from a textual description or address. Nominatim supports structured and free-form search queries. Docs: https://nominatim.org/release-docs/latest/api/Search/
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export function nominatimSearch(params: Search): Promise<Place[]> {
return fetchJSON(
"https://nominatim.openstreetmap.org/search?" +
asdf
@popkorn123
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY Todos I'm looking for collaborators to help. Fork & send me PRs! [ ] Experiment with two prompt chain (started here )
HTTP
import { STARTER_PROMPTS } from "https://esm.town/v/stevekrouse/cerebras_coder_prompts";
function extractCodeFromFence(content: string): string {
const match = content.match(/```(?:html|typescript|js|javascript)?\n([\s\S]*?)```/);
return match ? match[1].trim() : content.trim();
function App() {
const [prompt, setPrompt] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function generateCode(prompt: string, currentCode: string) {
const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
totalTokens: completion.usage?.completion_tokens || 1,
export default async function server(request: Request): Promise<Response> {
if (request.method === 'POST') {