Live data from Hacker News

Turn your browser into a notepad with one line

coderwall.com

51–60 of 186 posts

Re: Turn your browser into a notepad with one line

#53
post #28

Forgive me for the shameless plug...but thought this might be useful for other HNers and related to OP. I put together a little project that uses the browsers localstorage so you can jot notes down and come back to them, I find it useful as I'm always in the browser, hope you do too: http://a5.gg

FYI local storage is not reliable, so you may want to think about a fallback, or at least putting a disclaimer explaining that what you write will probably but nitndefinitely still be there when you come back.

Re: Turn your browser into a notepad with one line

#54
post #34

This is what the scratch (EDIT: read scratch as * scratch * without the spaces--is there any way to escape that properly on HN?) buffer is for in Emacs, and I find it extremely useful. Also, unlike using a different tool, it allows me to use all the Emacs-specific features I usually rely on. (For example, I can easily type special characters like r₁ × r₂ ≈ r₃ using the TeX mode.) If you want more than one scratch buf…

There's also a "scratch" plugin for vim that offers similar functionality: http://www.vim.org/scripts/script.php?script_id=664

Re: Turn your browser into a notepad with one line

#56
I think the best part is how short and elegant it is.

I assume a lot of people won’t realize you can bookmark that URL since it looks so weird. Also, once you’re bookmarking, you can cheat and put more logic into the page. I made a slightly improved one with a dark background and larger font (hard to post the link on HN, so on a separate page):

http://mrcoles.com/one-line-browser-notepad-bookmark/

Re: Turn your browser into a notepad with one line

#57
post #19

For even more fun, turn your notepad into an interactive JavaScript environment: data:text/html, Then you can upgrade it by pasting in something like this: this.onkeyup = function () { this.style.backgroundColor = 'white'; try { eval(this.innerText); } catch (e) { this.style.backgroundColor = '#FFAAAA'; } }

Typing `alert("hi")` was a bad choice.

That's exactly what I did.

Re: Turn your browser into a notepad with one line

#60

Ah shoot. If Chrome allowed localStorage to be accessible from file:/// then we could add save (CTRL+S) and automatic load using this: data:text/html, window.onload=function(){var a=document.body;a.innerText=localStorage.mydoc;a.addEventListener("keydown",function(b){b.ctrlKey&&83==b.which&&(localStorage.mydoc=a.innerHTML,b.preventDefault())},!1)}; Firefox will save it to localStorage but clear the local storage afte…

That is so cool :). I just slapped together a (really) simple chrome ext for opening up a new tab in "contenteditable" mode. It saves the contents into localStorage, thats it for now :) Here it is if anyones interested https://github.com/jwaterfaucett/textpad
Post reply on HN