Joined August 2012
·
F700694ebf2911ddfcb0d25c5e0a97b1

Joel Kirchartz

Web Monkey
Web Monkey
·
Pittsburgh, Pa
·
·
·

Posted to One line browser notepad over 1 year ago

This is awesome, since everybody's throwing their hats into the ring, here's the short version of my notepad app:

<!doctype html>
<meta charset="utf-8">
<title>html5 notepad</title>
<textarea></textarea>
<script>
var n = document.getElementsByTagName('textarea')[0];
n.onchange = function(){localStorage.setItem("n",n.value);}
n.value = localStorage.getItem("n");
</script>

it uses localStorage, so it needs to be hosted, but that means it'll save your notes between visits... I have the long version of my simple html5 notepad app, which is a little beefier code-wise (there's a polyfil & css), but still butt-simple.

@milesj plain ems would cause issues when nested, probably better to use rem that way it's pegged to the body's font-size instead of it's parent element.

Posted to Testing almost any code in browser over 1 year ago

@vijayant I just added it, thanks!

I actually have this setup in my .bashrc like:

# serve dir as static site
alias serve="python -m SimpleHTTPServer"
Posted to Prevent VIM write misfires over 1 year ago

indeed this is a "crutch", in-so-much as BASH aliases are too. It only avoids a minor annoyance on the device you set it on. If you're on a server where you haven't set it up no harm done you just have to try again & hope your fingers aren't so chubby this time.....

Posted to Highlight invisible chars in vim over 1 year ago

I use this to match the way TextMate does it:

set listchars=tab:▶-,trail:•,extends:»,precedes:«,eol:¬

Since I'm using solarized color set they all come through as having a very noticeable red background, so I can avoid trailing spaces and odd tabs.

That's a lot of voodoo, you can get away with something like this:

command W w
Posted to BASH history tricks over 1 year ago

Also with bash you can repeat the last command while replacing a string within it. So if your last command was vi file.txt and now you realize you need to edit file2.txt you can type ^file^file2 ... I know it's not a great time-saver in this example, but if you have something hidden in a long command that you need to change it's a time-saver.

Achievements
211 Karma
7,558 Total ProTip Views