3 ms·
Show HN: A url only notepad that hosts itself
I like playing around with bookmarklets (bookmarks that are executable JavaScript)
And I wanted to make a Quine (code that prints a copy of its own source code ad infinitum)
So I made a bookmark-only notepad that saves a copy of its own executable and current state to a JavaScript executable bookmarklet.
As you type, a link on the page updates with the source code and the internal state. You can drag this link to the bookmarks bar to “save” your work. Works cross device if you have browser sync on.
No server involved!
- purple-leafy 3y agoNext step: a self hosting JavaScript REPL + snippet manager for common web page userscripts
- datascienced 3y agoIt’s a virus! ;-) Nice idea.
- matricaria 3y agoA virus that can do `echo hello > file`.
- metadat 3y agoDoes it work on mobile?
- nmstoker 3y agoWill depend on which browser you want to use (on mobile). Assuming the core editing code runs in mobile Mozilla, the sync aspect should work and I've used bookmarklets in mobile browsers before.
- purple-leafy 3y agoI honestly haven’t tried mobile yet. But have tried pc to pc and that worked
- nico 3y agoThis is really cool, love the idea of truly serverless and the whole thing being a self-generating quine I’ve built a few tools in the same spirit (“true” serverless), but never had it output its own code and state Are you thinking of adding more features, or did you just want to prove you could build it?
- purple-leafy 3y agoJust built it to prove that it can be done, but have a few other ideas that leverage the clients browser. I’d love to spin it into a sec hosting JavaScript REPL and snippet manager too
- shsbdncudx 3y agoIt’s pretty cool. Definitely not a world first. Not even a HN first, I’ve seen these posted occasionally over the year. Still like it though!
- purple-leafy 3y agoYeah I was sniffing my own farts a bit when I made it :P fun little project
- davidcollantes 3y agoSorry if I am missing something, but, how do you run this? Just drop the .JS on a browser?
- dleeftink 3y agoIf my knowledge of bookmarklets is correct, you can input JavaScript code into the url field of any browser bookmark. In case of this quine, you can drag and drop it on your bookmark bar to create new notes from the initial bookmark.
- purple-leafy 3y agoSo the js file in the repo, you would make a new bookmark and paste the JavaScript as the url :) But be sure it’s safe before doing so with random internet code
- waltbosz 3y ago"Note: Whenever you copy code from the internet please do understand what it does before executing it" Good note to include. I've wrote an app like this where the install method requires executing code in the js console, and I always feel a little icky training users to run random code off the Internet. I include a similar warning. I like your bookmarklet idea, I wonder if it will work with my app.
- purple-leafy 3y agoWhat’s your app friend?