Friday, May 29, 2015

Lots of named tabs--like a scite session but for Gnome Terminal

Open a bunch of bash tabs simultaneously and give them different titles.  Nice!
 
#!/bin/sh 
gnome-terminal \
--tab -t "notes" --working-directory=$HOME/notes  \
--tab -t "puppet" --working-directory=$HOME/puppet \
--tab -t "beamish" --profile=root-beamish           \
--tab -t "odyssey" --profile=odyssey                \
--tab -t "root" --profile=root

Friday, May 22, 2015

More organized javascript

I do a lot of writing in Python and everything seems to be nicely arranged and easy to follow and then I go to what I've written in Javascript and jQuery and it looks like a mess.  It's comparatively hard to follow even much smaller tracts of code.

So here are a couple of resources on organizing Javascript code.
 
http://alistapart.com/article/the-design-of-code-organizing-javascript
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/

Wednesday, May 20, 2015

Today I learned that properties can't be accessed as functions

It took a long time for me to debug something that was simple.

I had a method defined as a property and I built another method that took its output.

Out of habit, I called the function.  And my operation failed.  The lesson was pretty simple: don't try to call a property.  It's a value now, not a method.