Saturday, December 10, 2011

Node, Express, Redis, Jade, Ayn Rand

More winning answers from today:
http://github.com/mranney/node_redis/issues/60
http://stackoverflow.com/questions/5748087/using-javascript-code-in-jade-views-ifvariable-shows-undefined-instead-of-pa 

Instead of using ANOTHER npm package, I figured I can just call a function from inside the callback function that looks like this:

function renderPage(view, res, renderObject){
  res.render(view, renderObject);
}
view = 'login'
res = response from the route
renderObject = the modified object (we put Redis data in this one) from inside the callback that we want to pass to Jade.

THIS IS BECAUSE YOU CANT CALL res.render MORE THAN ONCE PER ROUTE!!!! but you CAN CALL THAT EXTERNAL FUNCTION AS MUCH AS YOU WANT~ (I think)

Also just discussed "social chess" and then thought about a hypothesis that Ayn Rand was more autistic on the spectrum, googled in order to see others with similar thoughts:
http://www.wrongplanet.net/postt33433.html

No comments:

Post a Comment