Live DOM nodes

Maybe I am just naive, but I am used to jQuery’s static node, meaning the change in the DOM structure is not reflected automatically in a queried result.

It turns out some native methods are live or reactive. Three of them are:

This means the following code is an infinite loop:

var divs = document.getElementsByTagName('div');
for(var i=0; i<divs.length; i++){

Pick an editor library

WYSIWYG choices:



4 medium.js forks: (my favorite so far)

Very interesting implementations:


The classic:

The minority:


Git merge several repos

There are many ways to do it.

One way is:

– Clone old-repo1 to local machine

– Move everything to old-repo1/old-repo1

– Go to new directory

– Git remote add old-repo1 ../old-repo1

– Git pull old-repo1 master


There is always a hard step. I use the following script to move old files to its sub directory

for file in $(find . -maxdepth 1 -type d -not -name '.*'); do git mv $file $(echo $file | sed -e 's/^/sub_dir\//'); done

for file in $(find . -maxdepth 1 -type f); do git mv $file $(echo $file | sed -e 's/^/sub_dir\//'); done


Looks like the entire prelinked team is hired

Looks like all of our four team members from Prelinked are hired as of today. Yes!!!

Team matters a lot in Hack Reactor. For one, the project / tech stack is important. For another, your teammate will be your best ally in the interview process. We practiced interviews together, revised each other’s resume and passed down leads when one person has already taken a job offer. The best part is the mutual supporting. Without the team, the job hunting process would be a much harder one.


The only time I got it right

I have been practicing predicating start-ups  for a while and I tend to be horribly wrong. But I think I might be getting better and better over time. Two companies I liked a lot both raised a significant amount of money recently.

One is Memoto, which changes its name to Narrative. You can visit them here: They raised $3M in a round led by San Francisco-based True Ventures.

The other is Loom, which recently raised $1.4M seed.


Next on my list:

– If they pivoted well, they have the opportunity to become the next Yammer.



Now I know why employers are impressed when we talked about daily stand-up, 2 days sprints and weekly releases, because that is highly relevant to the workplace.

I wanted to share some of the scrum notes, since most of them are in the public domain anyway.

What is scrum:

– A subset / branded version of agile. Agile is the opposite of waterfall. Waterfall is borrowed from classic engineering, i.e. building a bridge requires a huge amount of planing prior to construction.


– Product owner

– Dev team

– Scrum master

What do they do:

– Product owner creates user stories and he is responsible for the ultimate success of the product.

– Dev team.

– Scrum master has no managerial authorities. He is a facilitator to remove the road blocks for the dev team.


– Prioritized backlogs, with each backlog representing a user story.

– Backlog review meeting. Can be informal.

– Sprint planning. One week duration for now, preferably with several user stories per sprint.

– Daily stand-ups. Answer three questions: what did you do yesterday, what are you going to do today, are there blockers?

– End of sprint with one sprint review and one retrospective review. Sprint review should demonstrate each finished user story. Retrospective review is where everyone provides feedbacks regarding systems and processes.

User stories:

– Make sure all engineering efforts are impacting users.


yo backbone

There was a bug with yo backbone with require.js

The fix is:

Fix : As soon as I go to start creating new app. I hit ctrl+c and stopped the process. Then I went to the package.json file which is created and updated it based on this stack overflow discussion asciidisco/grunt-requirejs#65

“grunt-requirejs”: “*”, to “grunt-contrib-requirejs”: “*”.


how to set up one testing system for both front-end and backend

Huge working in progress because I haven’t figured everything out yet.

Unit test is:
– fixed input
– expected a fixed output

Testing frameworks:
– Mocha
– Jasmine

Assertion libraries:
– Chai

//backend code
var expect = require('chai').expect;

var _ = {};
if(typeof module !== 'undefined'){
  module.exports = _;

How to set up mocha:

npm install -g mocha
npm install chai mocha
#put the following code in mocha.opts
#mocha --reporter spec

The directory structure:

???not sure???
In browser:

var expect = chai.expect;

To test async code in mocha, use done()

it('should test async function', function(done){
	}, 500)

Third party services:
– Travis-ci
– code-coverage, whether that particular line of code has been run in the test
– selenium
– browserling


Consolidating VPS

Have tons of VPSs laying around, running all kinds of side projects. Finally have a time to consolidate them.

It is clear that there are several tiers:

– production tier:, expensive but fast and reliable

– dev tier: any random cheap vps you can find on

– the uprising star tier that might be good for production: digitialocean, I am amazed by how powerful their admin dashboard is. They really go out of their way to make my life much easier.

Also, I followed this article to download my linode image to the local machine. The key command is:

#reboot linode server to rescue mode
#set a new password for root
#start sshd
/etc/init.d/ssh start
#might have to del lines in ~/.ssh/.known_hosts 
ssh -C root@linode_ip "dd if=/dev/xvda " | dd of=linode.img