Max McDonnell
@maxmcd.bsky.social
📤 75
📥 148
📝 16
making servers less
@cloudflare.social
, previously
@val.town
, @voltus, he/him, 🏳️🌈
reposted by
Max McDonnell
Heyo. I used to work on infra at Val Town. I hacked together a quick and dirty version that uses the actual contents of the posts and runs them in cloudflare dynamic workers:
phew.network
loading . . .
phew.network
https://phew.network/
5 days ago
1
9
2
```js import{C}from"at://maxmcd.bsky.social/3mdycjg6nv22n" import{H}from"at://maxmcd.bsky.social/3mdycjwkdp22n" export let V=(u,p)=>new Response('<style>'+C+'</style>'+H(u)+p.map(x=>'<div class=p><b>@'+x.u+'</b> '+x.t+'</div>').join\`\`,{headers:{"content-type":"text/html"}}) ```
5 days ago
0
0
0
```js export let H=u=>'<h2>@'+u+'</h2><form method=post><input name=t placeholder="Post something"><button name=a value=1>Post</button></form><form method=post><input name=b placeholder=Follow><button name=a value=0>+</button></form><hr>' ```
5 days ago
0
0
0
```js export let C='*{box-sizing:border-box}body{font:16px system-ui;max-width:500px;margin:0 auto;padding:1em}input,button{padding:.5em}input{width:70%}.p{padding:.5em 0;border-bottom:1px solid
#eee
}' ```
5 days ago
0
0
0
```js import{F,P,T}from"at://maxmcd.bsky.social/3mdybmgydos2n" export default{async fetch() { return Response.json({F,T,P}) }} ```
5 days ago
0
0
0
```js export let F="INSERT INTO f VALUES(?,?)",P="INSERT INTO p VALUES(?,?)",T="SELECT*FROM p,f WHERE f.a=? AND p.u=f.b" ```
5 days ago
0
0
0
```js export default { async fetch(req, env) { await env.DB.exec(`CREATE TABLE IF NOT EXISTS c(n INT);INSERT INTO c VALUES(1)`) const r = await env.DB.prepare("SELECT COUNT(*)c FROM c").first() return new Response(`Hits: ${r.c}`) } } ```
5 days ago
0
0
0
```js import { greet } from 'at://maxmcd.bsky.social/3mdxxvwx4r227'; export default { fetch(request) { return new Response(greet("World")); } } ```
5 days ago
0
0
0
```js export function greet(name) { return `Hello ${name}` } ```
5 days ago
0
0
0
```js export default { fetch(request) { return new Response("Hello from Bluesky!"); } } ```
5 days ago
0
0
0
reposted by
Max McDonnell
Tom MacWright
5 months ago
this summer
@val.town
had an intern, and he was truly kickass: read about how
@404wolf.bsky.social
put the
@deno.land
LSP server in a cloudflare container, made it speak websockets, wired it up to codemirror, and made the whole thing scale:
blog.val.town/vtlsp
loading . . .
Building a better online editor for TypeScript
Updates and articles from the Val Town team
https://blog.val.town/vtlsp
1
37
9
HTTP1 over HTTP2 over HTTP3
maxmcd.com/posts/http321/
loading . . .
HTTP3, 2, 1
HTTP1 is simple and easy. With enough care you can open a TCP connection and hand-write an HTTP request to a server and get a response. Good fun. HTTP2 is more complex. Multiple bidirectional requests...
https://maxmcd.com/posts/http321/
12 months ago
0
3
0
you reached the end!!
feeds!
log in