Avatar

jonbo

writing code and words
Joined August 2, 2023
Public vals
6
jonbo avatar
dynamicSleep
@jonbo
HTTP (deprecated)
Ever needed to fake a serverside delay? https://jonbo-dynamicsleep.web.val.run will return after 1 second. https://jonbo-dynamicsleep.web.val.run?seconds=5 will return after 5 seconds.
jonbo avatar
MADBOTS
@jonbo
Cron
MAD BOTS (Multi-functional Alerting & Diagnostics Bot Operations Tracking System) This val runs every two minutes and makes sure a supabase realtime websocket listener is still alive. on spawn, checks to see if acknowledged_by_server == true if not, send a message to discord update the row (id=1) in supabase with acknowledged_by_server: false to reset for next run this will be responded to by the supabase handler. code snippet below: .on( "postgres_changes", { event: "UPDATE", schema: "public", table: "uptime", }, async (payload) => { // this means we just acknowledged it if (payload.new.acknowledged_by_server) { console.log('uptime check already acknowledged - skipping'); return; }; console.log('incoming uptime check request', payload); if (!payload.new.acknowledged_by_server) { await supabaseAdminClient.from('uptime').update({ acknowledged_by_server: true, acknowledged_at: new Date() }).eq('id', payload.new.id); console.log('uptime check acknowledged'); } } ) note: this will keep alerting every two minutes until acknowledged. something to resolve in the next version.
jonbo avatar
lableaks
@jonbo
HTTP (deprecated)
An interactive, runnable TypeScript val by jonbo
jonbo avatar
reactSSRExample
@jonbo
Express (deprecated)
An interactive, runnable TypeScript val by jonbo
jonbo avatar
nearbyJonBo
@jonbo
Script
Forked from tmcw/big_story_visualization
jonbo avatar
fetchBcycleCounts
@jonbo
Script
An interactive, runnable TypeScript val by jonbo
Next