Xah Web Dev Blog Archive 2014-01

saucelabs.com A service that automatically run your testing on combination of browsers/OS.

learned a new thing today. JavaScript Promises. looking to see what it is now.

looks like Google Search killed blog and discussions search, about 3 days ago.

Getter/Setter Properties (updated)

the keyword 「new」 Demystified (major update)

Should You Move Variables to the Top? (on its own page)

HTML5 Custom Data Attribute

made a site-wide change of format. This:

<s class="deadurl" title="accessed:2006-01-05; defunct:2011-06-12">http://example.com/index.html</s>

is now this:

<s data-accessed="2006-01-05" data-defunct-date="2011-06-12">http://example.com/index.html</s>

this is a better format, using HTML5 Custom Data Attribute. However, now the user can't see the date accessed. Before, reader can see it when mouse hovers over. So, it's a hard decision to make.

JS: never use 「delete」 to remove element in array

Delete operator

CSS: Box Shadow (updated)

JavaScript: Change CSS (updated)

CSS: Progress Bar Example and HTML: meter Tag (updated)

CSS Layout Tutorial (minor update)

CSS: font-size

Where is Socket.IO Client Library At?

Web Design Idiocy: Non-Copyable Text

one of the idiocy of web design is this: a piece of text that you cannot copy. Usually the title. Here's a prime example: [Introducing WebSockets: Bringing Sockets to the Web By Malte Ubl, Eiji Kitamura. At www.html5rocks.com… , accessed on 2014-01-04 ] (must use Firefox.)

Websocket + JavaScript + Node.js = Future

websocket is the future. I think, in a couple of years, vast majority of websites will be using websocket. Meaning, with server push. Meaning, to the user, a site will have dynamic info, auto updated (most social sites, are already this, example: Google Plus, fb, twitter, and any stock sites or sites with dynamic news. Also Google Analytics's graph is also a example. Basically any sites that has graph).

also, i predict JavaScript and Node.js will overtake backend.

Node.js is very young, but there are incredible amount of stuff and force going on. Agile is the word.

Node.js server monitor/auto-restart

to install a monitor for your server written in Node.js, you can use nodemon. It'll watch your server process, and auto restart it if it crashed. It can also restart when source code change. Very handy for dev.

[2014-01-02 https://github.com/remy/nodemon ]

npm install -g nodemon

to start your process, do: nodemon nodeScript

type nodemon -h for help.

another popular one is npm install supervisor -g. [2014-01-02 https://github.com/isaacs/node-supervisor ]

and yet another popular one is [2014-01-02 https://github.com/nodejitsu/forever ]

here's a list of generic server monitor tools. (i haven't checked them out)