Month: May 2016

JavaScript Details

  1. Function Closures   –                             http://www.w3schools.com/js/js_function_closures.asp   http://javascriptissexy.com/understand-javascript-closures-with-ease/       http://stackoverflow.com/questions/12930272/javascript-closures-vs-anonymous-functions?rq=1  http://stackoverflow.com/questions/1140089/why-do-you-need-to-invoke-an-anonymous-function-on-the-same-line?rq=1       http://stackoverflow.com/questions/111102/how-do-javascript-closures-work?rq=1 http://stackoverflow.com/questions/500431/what-is-the-scope-of-variables-in-javascript?rq=1
  2. JavaScript where to put <script> tag                     http://stackoverflow.com/questions/436411/where-is-the-best-place-to-put-script-tags-in-html-markup
  3. Use strict –                                                         http://stackoverflow.com/questions/1335851/what-does-use-strict-do-in-javascript-and-what-is-the-reasoning-behind-it?rq=1  http://yuiblog.com/blog/2010/12/14/strict-mode-is-coming-to-town/
  4. SpiderMonkey. SpiderMonkey is Mozilla’s JavaScript engine written in C/C++. It isused in various Mozilla products, including Firefox, and is available under the MPL2. Standalone source code releases can be found on the Releases page
  5. JavaScript Engines: http://developer.telerik.com/featured/a-guide-to-javascript-engines-for-idiots/
  6. Run Compiled JavaScript in browser – https://www.quora.com/Why-does-V8-only-compile-JavaScript-on-runtime-instead-of-giving-developers-the-option-to-supply-compiled-code
  7. Is Javascript compiled or interpreted language – http://stackoverflow.com/questions/9623813/is-javascript-compiled-or-an-interpreted-language
  8. How is Javascript code executed on V8 engine in Node.js – https://www.quora.com/When-an-application-runs-on-Node-js-does-that-mean-JavaScript-is-being-compiled-to-machine-code-using-V8-and-executed
  9. EcmaScript6 support on chrome – http://stackoverflow.com/questions/24008366/using-ecmascript-6
  10. Wrapping entire javascript files as closures – http://stackoverflow.com/questions/2421911/what-is-the-purpose-of-wrapping-whole-javascript-files-in-anonymous-functions-li?noredirect=1&lq=1
  11. Difference between JVM and V8 javascript engine                    https://www.quora.com/Is-V8-the-JavaScript-engine-a-virtual-machine-platform-like-the-JVM-If-not-in-what-way-is-it-different/answer/David-Greenspan
  12. When to use Node.js –                        http://stackoverflow.com/questions/5062614/how-to-decide-when-to-use-node-js?rq=1
  13. Best way to re-use javascript to be executable in browser and node server – https://www.quora.com/Whats-the-best-way-to-use-JavaScript-code-in-both-the-browser-and-Node-js
  14. Node Package Manager – https://www.sitepoint.com/beginners-guide-node-package-manager/
  15. Node.js cannot find required module in windows  http://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows
  16. Node.js examples                                                      http://code.tutsplus.com/tutorials/learning-server-side-javascript-with-nodejs–net-10044
  17. What is Node.js –                                        http://stackoverflow.com/questions/1884724/what-is-node-js?rq=1
  18. Purpose of self executing function in Javascript –  http://stackoverflow.com/questions/592396/what-is-the-purpose-of-a-self-executing-function-in-javascript?rq=1
  19. Nginx + Node.js – http://stackoverflow.com/questions/5009324/node-js-nginx-what-now?rq=1
  20. Cannot find node.js module installed locally -http://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows
  21. Writing files in Node.js –             http://stackoverflow.com/questions/2496710/writing-files-in-node-js?rq=1
  22. Debugging Node.js script –                  http://stackoverflow.com/questions/1911015/how-do-i-debug-node-js-applications?rq=1
  23. When to use Node.js –                             http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/     http://stackoverflow.com/questions/5062614/how-to-decide-when-to-use-node-js?rq=1                                                                     http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb                                       http://stackoverflow.com/questions/5009324/node-js-nginx-what-now?rq=1             http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb                                                   http://stackoverflow.com/questions/1884724/what-is-node-js?rq=1

 

Moment Js

https://jsfiddle.net/FLhpq/4/

$(function(){
setInterval(function(){
var divUtc = $(‘#divUTC’);
var divLocal = $(‘#divLocal’);
//put UTC time into divUTC
divUtc.text(moment.utc().format(‘YYYY-MM-DD HH:mm:ss’));

//get text from divUTC and conver to local timezone
var localTime = moment.utc(divUtc.text()).toDate();
localTime = moment(localTime).subtract(3,’day’).calendar(null, {
sameDay: ‘[Today] HH:MM A’,
nextDay: ‘[Tomorrow] HH:MM A’,
lastDay: ‘[Yesterday] HH:MM A’,
sameElse: ‘DD/MM/YYYY’
});
divLocal.text(localTime);
},1000);
});