Search

Results include substring matches and semantically similar vals. Learn more
lawrencewu avatar
myApi
@lawrencewu
An interactive, runnable TypeScript val by lawrencewu
Script
export function myApi(name) {
return "hi " + name;
mattrossman avatar
myApi
@mattrossman
An interactive, runnable TypeScript val by mattrossman
Script
export function myApi(name) {
return "hi " + name;
gigmx avatar
diligentSapphireOrca
@gigmx
An interactive, runnable TypeScript val by gigmx
HTTP
export default async function(req: Request): Response {
const url = new URL(req.url);
const connectionStatus = document.querySelector("#connection-status");
// Dropdown menu functionality
const menuButton = document.getElementById('menuButton');
console.error('Error clearing conversation:', error);
function parseResponse(text) {
const parts = [];
connectionStatus.style.display = "block";
document.getElementById("input").addEventListener("submit", async function(event) {
event.preventDefault();
document.querySelectorAll(".suggestion-button").forEach((button)=>{
button.addEventListener("click", function() {
const input = document.querySelector("input[name=\\"message\\"]");
mjd avatar
hnClojure
@mjd
An interactive, runnable TypeScript val by mjd
Cron
import { hnEmail } from "https://esm.town/v/stevekrouse/hnEmail?v=20";
import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
export async function hnClojure({ lastRunAt }: Interval) {
let posts = await hnLatestPosts({
query: "clojure",
patmood avatar
myApi
@patmood
An interactive, runnable TypeScript val by patmood
Script
export function myApi(name) {
return "hi " + name;
sbecker avatar
myApi
@sbecker
An interactive, runnable TypeScript val by sbecker
Script
export function myApi(name) {
return "hi " + name;
lawliet avatar
myApi
@lawliet
An interactive, runnable TypeScript val by lawliet
Script
export function myApi(name) {
return "hi " + name;
saolsen avatar
ace
@saolsen
@jsxImportSource npm:hono/jsx
HTTP
return c.render(
<div id="editor">
{html`function foo(items) {
var x = "All this is syntax highlighted";
return x;
</div>,
export default async function handler(req: Request): Promise<Response> {
return await app.fetch(req);
pomdtr avatar
publicBlushSnipe
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { Failure, Success } from "https://esm.town/v/pomdtr/neverthrow";
const demoFunction = () => {
const result = Math.random();
if (result > 0.5)
"Math. random produced too high a number",
return Success(result);
const res = demoFunction();
if (res.success) {
console.log(res.data);
all avatar
spottySilverHawk
@all
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const [activeButton, setActiveButton] = useState(null);
</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(`
ragnar avatar
myApi
@ragnar
An interactive, runnable TypeScript val by ragnar
Script
export function myApi(name) {
return "hi " + name;
bentz avatar
myApi
@bentz
An interactive, runnable TypeScript val by bentz
Script
export function myApi(name) {
return "hi " + name;
jqxu avatar
myApi
@jqxu
An interactive, runnable TypeScript val by jqxu
Script
export function myApi(name) {
return "hello " + name;
piotr avatar
myApi
@piotr
An interactive, runnable TypeScript val by piotr
Script
export function myApi(name) {
return "hi " + name;
jeremys avatar
Breathe
@jeremys
A very simple breathing tool I made for folks who may get panic attacks or just need to regulate their breathing Pure HTML, CSS, and JS!
HTTP
export default async function(req: Request): Promise<Response> {
const query = new URL(req.url).searchParams;
let timerId;
function startBreathing() {
const totalDuration = parseInt(timerElement.value) + parseInt(holdTimerElement.value);
breathText.textContent = 'Inhale';
function breatheCycle() {
breathText.textContent = 'Inhale';
breatheCycle();
function stopBreathing() {
innerCircle.style.animation = 'none';
holdTimerElement.addEventListener('input', updateHoldTimerValue);
function updateTimerValue() {
document.getElementById('timerValue').textContent = timerElement.value;
startBreathing();
function updateHoldTimerValue() {
document.getElementById('holdTimerValue').textContent = holdTimerElement.value;