Posts

Showing posts with the label server

(က) Polpetta, any folder is served spiced

The quick version is: have you ever thought about using node.js to make any folder as a web-server and in a PHPish way where .njs files are required and executed runtime as node modules ? Oh well, I did, and this is the result in Github: polpetta ... enjoy!

Simulate Script Injection Via Data URI

Well, not only downloads on the fly , the data uri works for almost everything ( only iOS 5 beta does not want to work with inline data uri AUDIO sources .... but this is another story ... ) ... so ... How To Simulate Script injection Let's say you want a test but you don't want to bother a server. However, you want to be sure the test is asynchronous and it simulates the server. var head = document.getElementsByTagName("head")[0], script = document.createElement("script") ; head.insertBefore(script, head.lastChild); script.src = "data:text/javascript;base64," + btoa( "alert('Hello World')" ); How To Simulate JSONP Same trick, isn't it? ... except: script.src = "data:text/javascript;base64," + btoa( "callback(" + JSON.stringify(dummyData) + ")" ); How To Drop Server Requests well, this is the tricky one ... Surely there is some job to do in the createResponse() function but ... he...

HTML5: How To Create Downloads On The Fly

this is a quick one I have implemented already in fuckn.es in the create angry memory button logic ... The New Download Attribute Hopefully soon, most updated browser will implement the download attribute in hypertext links (aka: <a> tag) The quick summary is this one: The download attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. The attribute may have a value; the value, if any, specifies the default filename that the author recommends for use in labeling the resource in a local file system. And this is a basic example: click here to <a href="resource234.txt" download="license.txt" > download the license </a> What Is Download For Well, I am pretty sure you have read at least once in your life this kind of extra info beside a link: right click to download the content and "Save As ..." Moreover, I am pretty sure you have created at least once in your server a page ...

CommonJS - Why Server Side Only?

There is one single thing I don't like about CommonJS Idea , the fact nobody is thinking about the client side!!! CommonJS Why Since everybody would like to use JavaScript as Server Side Programing Language , where right now I can count there about 50 implementations, somebody decided that at least basic stuff such IO operations, streams or sockets, and much more, should have a common behavior, namespace, API, across all different implementations. In few words, these guys are trying to create their own WSW Consortium , and this is absolutely OK. So what am I complaining about? Client CommonJS If we, as developers and libraries authors, would have adopted a similar strategy ages ago, rather than fight with each other about natives prototypes pollutions, web development would be probably even easier for everybody. We failed, while those server side guys started correctly. The problem, for both language usage and its environment, is that JavaScript on server has different problems th...

packed.it goes off line !

... or, to be honest, that's what it's gonna do in few days, but PHP version is out ! You can find every information about server side version of packed it directly in this page . I am not joking when I said that packed.it is probably the fastest optimized client files server you can find over the net, even with an uncompiled program language like PHP. The key is the JOT compiler, compile one time, serve all the time without paranoia, saving bandwidth for both server and client, avoiding the usage of gz handlers, avoiding runtime compression, avoiding whathever you want, and finally, having the possibility to serve js, css, or both with a single file. Discover by yourself how long server need to serve, for example, jQuery ... less than one millisecond without louds of requests ... please look at X-Served-In header, if you do not trust me :P What's new? You do not need to pass in packed.it site to compile your projects, you can just serve and compile them directly from yo...