May, 2011

29
May 11

node-inspector and the missing –start-brk option

Quick tip to anyone having trouble finding the right way to start a node-inspector debugging session with an initial break point. Lot’s of youtubes and how-to’s mention a –start-brk=file.js option. If you try and actually use it, it doesn’t work. The correct way to do this now is:

node-inspector &
node --debug-brk --debug server.js 

Head to http://0.0.0.0:8080/debug?port=5858 to find your app nicely stopped on the first line.

Happy noding!

21
May 11

Kilnauth Plugin for Mercurial on a Mac

Do you use Kiln from FogCreek? Do you use a Mac? Are you having trouble getting the kilnauth plugin to work on your Mac? If so, you probably have a bad hgcookies file. To fix:

  1. Find a colleague with Windows who has a properly functioning kiln client (or follow the process in this kiln stackexchange post).
  2. Have them open up their user profile and look for an _hgookies folder. Open the cookie file inside.
  3. There will be a line that looks something like (DBID’s have been changed to protect the innocent): servername FALSE / FALSE DBID o1sev3t3dn01dabdppin90wexczimb
  4. Have them send you the DBID value
  5. On your Mac, open the cookie in your ~/.hgcookies/ and add the missing DBID value.
  6. You might have to hg logout, then try an hg get/in to put your credentials in. After that it should stop prompting you.
16
May 11

Impress your friends with client side updates

Of the many life lessons I have learned creating nodechat.js, one of the most poignant was that people like to leave their browsers (and tabs) open for a long time. This should not have been a surprise to me–I often have tabs open for weeks in the vain hope that I will get back to whatever I was doing on that page someday. This phenomena meant that users would log into nodechat, click away to another tab (or restart their browser, or suspend their PC), only to revist the nodechat tab later and find that the chat appeared frozen. The same issue occured everytime I pushed a new server update: all clients would be cut off until the user refreshed the page. Clearly this was a subpar user exeperience. This is how I fixed it.

Continue reading →