Live data from Hacker News

Turn your browser into a notepad with one line

coderwall.com

41–50 of 186 posts

Re: Turn your browser into a notepad with one line

#42

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…

Even the simple File - Save Page As and save as a txt file saves a lot of time for me. I know it adds more clutter but beats opening a new app just to type few things.

Re: Turn your browser into a notepad with one line

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

It took me a few goes to figure out I could just click OK.

Re: Turn your browser into a notepad with one line

#45

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…

Firefox has Ctrl+Shift+K for its web console. It's not as polished as Chrome's, but at least allows running JavaScript in the current page.

Re: Turn your browser into a notepad with one line

#46
post #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.

I think I like it because of how weirdly constrained it is. Especially when you're writing something that will overwrite the handler itself, it's easy to get yourself stuck in a loop or a strange dead end.

Re: Turn your browser into a notepad with one line

#47

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…

Apropos of nothing I believe this works because it frees up space in your brain. Sometimes, when I'm trying to get too much done at once, I'm stressed out by trying to keep to many things in the forefront of my thoughts at once. When I get stuck like that I create a scratch pad document with three 'zones'

   Doing:
      stuff I'm working on right now

   ToDo:
      Stuff that I know needs to get done

   Done: 
     Stuff that is now done.
Start by dumping everything I'm thinking of in 'Todo' and pick one and put it in Doing and while I'm in the middle of doing it when I think thoughts like "oh and this should really do x" I add that to the Todo pile and go back to doing. Each time I finish of the 'Doing' task I scan the todo list, move anything I need to into Done and pull one up for the Doing pane.

By externalizing the bookkeeping of all the things I'm trying to keep straight in my head I free up cycles to actually work on something.

Re: Turn your browser into a notepad with one line

#49
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…

[deleted]

Re: Turn your browser into a notepad with one line

#50
Nice gimmicky hack but not so practical.

Just pin notepad/your favorite editor to the taskbar(win7+) and open it with win+shift+[whatever number that corresponds to the position you placed notepad on the taskbar].

Much faster and much more powerful.

Post reply on HN