Posts

Showing posts with the label node

A Meaningful Client Side Alternative To node require()

TL;DR Here you have the solution to all your problems ... no? So take a break, and read through :) Current Status Using a generic " module loader " for JavaScript files is becoming a common technique, and full of wins, not only on the node.js server side. There are different client side alternatives , not entirely based over the module concept, and apparently only one concrete proposal, called AMD , able to work in both server and client following a build/parsing procedure. However, as somebody pointed out already ... AMD is Not the Answer This post does not even tell everything bad about AMD problems, and I am getting there, but it's surely a good starting point. Tobie article is another resource that inspired somehow what I am going to propose here, so before discriminating this or that technique, I hope you'll find time to understand the whole problem ... found it? Let's go on then :) The Beauty Of node.js require Function I don't think I should even s...

Asynchronous Storage For All Browsers

I have finally implemented and successfully tested the IndexedDB fallback for Firefox so that now every browser, old or new, should be able to use this interface borrowed from localStorage API but made asynchronous. Asynchronous Key/Value Pairs The main purpose of this asyncStorage API is to store large amount of data as string , including base64 version of images or other files. As it is, usually, values are the bottleneck, RAM consumption speaking, while keys are rarely such big problem. However, while keys are retrieved asynchronously and in a non-blocking way, but kept in memory, respective values are always retrieved asynchronously in order to do not fill the available amount of RAM for our Web Application. Database Creation/Connection Nothing more than ... asyncStorage.create("my_db_name", function (db, numberOfItems) { // do stuff with the asyncStorage }); Storing An Item As it is for localStorage, but async asyncStorage.create("my_db_name", function (d...

back in town with a little CSS present

Hi everybody! I am definitively back in London: completely tanned, thanks to Ancona holidays, but right now under the rain (OK, in this second it's sunny here...) This is a quick " here I am again " but with a simple and little present: Easy CSS Reset Creator Sometimes we need to reset CSS to be sure that our document will be clear and hopefully equal for each browser, respecting our rules rather than browsers default. To better understand what I am talking about, please have a look into this Eric A. and Kathryn S. Meyer page , the basis used to create my simple tool. What Eric did not think about, is that thanks to Web 2.0 injections and flexibilities, it could be useful to reset a single node and everything contained rather than a full document, specially when we need quick improvements or our cool widget/gadget to add somewhere in the page without an iframe or inherited rules. So, this is the page able to create the CSS you need with or without a parent rule. If you...