Wednesday, July 17, 2013

Toilets and innovation

I have always been surprised by the difficulty that knowledge and innovation find to flow across cultures, fields, countries.

My wife just called me panicky to tell me that the washer water is coming out and it is all over the wooden floors. The most silly litlle thing and you have permanant damage to the floors. If I were in an appartment or a second floor the damage would extend to the ceiling of the guy below me. This disaster would never happen in Europe. There every toilet has in the middle what the showers have here: a small covered drain ,  and the toilet floor is always built in a way that it has a tilt towards that point. On top of avoiding flooding the appartment, it makes washing toilets a much less ugly chore.

(I will avoid discussing the details of the opposite problem. European toilet bowls haven't discovered the simple idea of being filled up with water (its more than that - they use a different flushing technique) Water is only at the very bottom which makes flushing/self cleaning a disaster compared to American toilets bowls...)


Nodejs development trick

I am developing an app . I have pushed out most of the functionality of the app in modules. The modules are relatively application specific - but they would allow someone to create a similar/slightly different app without having to deal/change much of the module-encapsulated code.
Any this has resulted in a 2 level deep dependence
 app depends on module1
module1 depends on module2.

To keep things developped in parallel modules are alredy in repos.. and published as they advance.
When I need to do some concurrent development across modules/apps how do I do it.

Here is my trick
I have cloned the repos of all three app, module1, module2 above.
I have run npm install in the app where I prefer to work
I run
> nodemon index.js 
in the app.
I remove the (sole code ) index.js in the node_modules and replace them with a soft link to the repos..
> cd node_modules/module1
> rm index.js
> ln -s ../../../module1/index.js .
> cd ../..
I do the same for the deeper module as well:
> cd node_modules/module1/node_modules/module2
> rm index.js

> ln -s ../../../../../module2/index.js .

At this point I can edit the module's index.js inside their own repos...as I would have like to do and the changes are automatically reflected in my app repo. Nodemon is smart , it does anyway a recursive decent and follows the symlinks... saving my index.js in the module repo results in nodemon restarting my app. 

The only problem is I need to remember and not do any destructive operations on the node_modules tree.


Living on github

1. I am happy/proud that my github contributions are getting denser :
Still I find it hard to keep a 7-day streak.. I think it has to do with the length of my code iterations.. (and yes one day I want my contributions chart to look like substack's :-).

2. Looking at my repositories I realize that I dislike the fact the home page becomes this endless list of .files. At a minimum every repo of mine would have 4 dot files:


The reason that I need to commit .gitignore, .jshint and .cover is that I collaborate with others. They fork the repo and .jshint is the coding rules that I want to enforce, .coverignore is the coverage I need them to have etc. So this is a feature request for github : please collapse the dot files as a "hidden file" line that one can expand at whim. This will make the list more similar to what you would get with an ls in unix.