Live data from Hacker News

Turn your browser into a notepad with one line

coderwall.com

31–40 of 186 posts

Re: Turn your browser into a notepad with one line

#31

Personally I'm more interested in the concept of typing gibberish to clear your mind. What particular kind of gibberish? Doggerel verse? Blind keyboard mashing?

I often do an exercise that I've started referring to as a "brain dump". Sometimes when I feel overwhelmed, for whatever reason, it helps to just simply start typing. I start by just saying whatever is most present on my mind, and each new thought starts on a new line. More often than not I end up drilling down to some kind of inner conflict buried pretty deep in my mind. What's really amazing is when seemingly unrel…

The thought of doing that is kindof scary. Who knows what I might end up typing!?

Of course, this is probably a reason to do it.

Re: Turn your browser into a notepad with one line

#33
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 afterwards. Weird.

Oh well.

At least we can still turn our (Chrome) browsers into desktop calculators by pressing CTRL+SHIFT+J!

(If you want the un-minified version of the code I wrote: http://jsfiddle.net/d5sGq/)

Re: Turn your browser into a notepad with one line

#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 buffer--which happens to me once in a while--you can just create a new buffer with any name, and it will also do. New buffers are in a different mode by default, but you can set it up to work exactly the same way as scratch if you want.

As another commenter pointed out, you can use the browser to evaluate JavaScript. Emacs lets you do the same thing with elisp in the scratch buffer by default: try entering in an elisp expression and pressing C-j.

Just a fun alternative to this trick for the Emacs users around here :).

Re: Turn your browser into a notepad with one line

#35
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'; } }

This is clearly awesome. First thing I did? Got into infinite loop. This is not exactly a good interactive console for JavaScript, but still very fun.

Re: Turn your browser into a notepad with one line

#36
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.

Re: Turn your browser into a notepad with one line

#37
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

I occasionally use a similar online tool, complementary to yours: http://notepad.cc. It stores each note online at its own URL, instead of per-computer at just the root URL. That lets you retrieve and edit notes across multiple computers. I mainly use notepad.cc if I’m using a someone else’s computer or a public computer and want to send some links or a note to myself.

Re: Turn your browser into a notepad with one line

#38

Earlier quoted context omitted.

I often do an exercise that I've started referring to as a "brain dump". Sometimes when I feel overwhelmed, for whatever reason, it helps to just simply start typing. I start by just saying whatever is most present on my mind, and each new thought starts on a new line. More often than not I end up drilling down to some kind of inner conflict buried pretty deep in my mind. What's really amazing is when seemingly unrel…

The thought of doing that is kindof scary. Who knows what I might end up typing!? Of course, this is probably a reason to do it.

I picked up on it from this site: http://750words.com/ It's rather cathartic, although you're right that letting your mind wander within a recorded stream sometimes means you write down some quite scary stuff, it's probably the same part of the brain that says "you could jump, you know" whenever you look over a high ledge

Re: Turn your browser into a notepad with one line

#39
post #18

Earlier quoted context omitted.

How do you save stuff in files from the browser? I've googled around about this a couple times and not found anything good, so if anyone can point to some clear documentation I'd appreciate it.

I'm on mobile so I can write to much accompanying text, but start here: http://www.html5rocks.com/en/tutorials/file/filesystem/

Thanks to both of you. I'll check it out.

Re: Turn your browser into a notepad with one line

#40

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…

If you can sacrifice the automatic load, simply hitting C-S will allow saving a hard file to disk.

What's particularly nice about this is that when re-opened, they are still editable.

Post reply on HN