ssh homeserver 'echo hi >> /var/www/self-published/index.html' and voila. I'll probably share my gist this way from the CLI.
ssh homeserver "echo '$(ls)' >> /var/www/self-published/index.html" if I want to run a command locally first, not on homeserver (notice the " vs ').
echo <input id=kmbefore><input id=kmafter onleave='alert( (kmafter.value - kmbefore.value) * priceperlitterperkm )'>
> index.html to make it available to anyone, Worldwide, for free!
You are conveniently leaving out that you already must have:* a server running 24/7 on the internet, paid for each month
* purchased, setup and keep paying every year a domain name
* configured a web server in that server, ideally with automated SSL certificate issue and renewal
Also, alerts are terrible UX. At least put some effort into your example.