My closest friend only uses email and over the years I have grown tired of writing a heading and a body every time to share something with him.
So I built this very simple link sharing board which generates boards with uuids and as long as you know the uuid, you can see the links on the page and add new links.
It is built with Imba (which was fantastic) and Supabase as the DB. Deployed on Netlify.
Sharing in case there is someone else who might find this useful.
How do you do that?
are you willing to share the Imba code for us to learn from? and how was the debugging experience on Chrome? Was there a large barrier to go from compiled down JS code to Imba source?
And here is one of the components:
import supabase, { UNIQUE_VIOLATION_CODE } from '../constants' import normalizeUrl from 'normalize-url' import './links-list'
tag pad-page
loading = false
links
err\string
newUrl\string
def routed
fetchLinks!
def fetchLinks
loading = true
let {data, error} = await supabase.rpc('select_links_from_pad', { pad_id_input: route.params.id })
.order('created_at', {ascending: false})
loading = false
if error
log error.message
return
links = data
imba.commit!
def addLink
if newUrl
const {data, error} = await supabase.rpc('insert_link_into_pad', {
pad_id_input: route.params.id,
url_input: normalizeUrl(newUrl, {defaultProtocol: 'https:'})
})
if error..code == UNIQUE_VIOLATION_CODE
err = 'link already added'
setTimeout(&, 3000) do
err = ''
imba.commit!
elif error
return
newUrl = ''
links.unshift(data)
<self>
<div[mt:5]>
<label[mr:3]> 'add a link'
<input
[bg:red4 c:white]=err
type='url'
bind=newUrl
@keydown.enter=addLink
>
<button[ml:1] @click=addLink> 'Add'
if err
<p[c:red5]> err
<links-list loading=loading links=links>They have a really cool effect on their homepage, curious how it works.
Imba is a real pleasure to work with. I have only good things to say about it. It brought back the joy in web programming for me.
The resource from “https://shynet-lhkb.onrender.com/ingress/f29fe2d5-5f78-456e-... was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
Also, console reports another issue:
SyntaxError: invalid regexp group client-SMJMSZTC.js:2:145487
FYI, the sudopad.com domain unfortunately displays nothing at all in my browser.
But I think I'll just remove it for now.
Update: removed
unreachable code after return statement[Learn More] index-LZXNJ15B.js:16:21954
TypeError: window.customElements is undefined[Learn More] index-LZXNJ15B.js:8:23994
But thanks for the idea, I might like to code something similar without using frameworks. I still miss the del.icio.us thingamajig sometimes
Both iOS and Android also feature extensive sharing functionality in their major browsers, and these go far beyond just email with apps that integrate the sharing API into them, e.g. I can share a URL directly to a contact on Element, bypassing email entirely, but likewise, on the same menu I can choose to email it to someone.
Well should have used that more!
I do like a board which I can search later though and also multiple boards for different friends and family etc.
User Agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2
(I'm certainly not requiring that you should support such niche tech, it's just a very old laptop that has a better form factor than my more recent ones, so I tend to prefer it for various situations)
Do you see yourself using sudopad then?
Anything which would make it even better?
Offline browser caching would be nice, even if that needs to happen via a browser extension, which might make sharing even easier, especially if you could pick a pad to add it to.
A Firefox extension would be beautiful and very much appreciated, mate.