It was a great event today at @co_up in @berlinjs meet-up and here are my sides about wru which accordingly with today meeting means where are you, directly out of SMS syntax.
This is a quick one already discussed during my recent workshop in Warsaw, a concept rarely considered or adopted from JS developers. What Are Polyfills If we are updated enough to know ECMAScript 5th Edition, we probably know all possible shims and fallbacks for Array extras as well (e.g. Array.prototype.forEach ). Polyfills are simply snippets able to bring features already available for most recent browsers into those not updated yet. Why Polyfills If we develop with present and future in mind, we can take advantage of most recent techniques and solutions in order to both speed up via native support, where available, and maintain our application just stripping out code once all target browsers support them natively ... isn't this cool ?! Polyfills Side Effects The most common side effect of a polyfill is performances impact . The Array::forEach is already a good example of decreased performances. If we think about a forEach, it's nothing different than a classic for loop , e...
Something " truly dangerous " to play with: a proxy file able to understand everything via XMLHttpRequest, enabling any sort of cross site requests (no COMET yet, it could arrive soon). Dunno even why I am posting this " little monster ", but I am sure a lot of people would like to have " access to the entire web " simply using Ajax, and nothing else, something like this: function website_exists(url){ var xhr = new XMLHttpRequest; xhr.open("HEAD", "proxy.php?url=" + (url), false); xhr.send(null); return 199 }; if(website_exists("http://gogle.com")) alert("Of Course, It's Big G!"); WebReflection PHP Proxy <?php /** XMLHttpRequest PHP Proxy * @author Andrea Giammarchi * @blog http://webreflection.blogspot.com/ * @license Mit Style License * @requires curl and Apache webserver * @description basic authentication, GET, POST, HEAD, PUT, DELETE, others ...
There are way too many ways to stub functions or methods, but at the end of the day all we want to know is always the same: has that function been invoked ? has that function received the expected context ? which argument has been passed to that function ? what was the output of the function ? Update thanks to @bga_ hint about the output property in after notification, it made perfect sense The Concept For fun and no profit I have created a prototype which aim is to bring a DOM like interface to any sort of function or method in order to monitor its lifecycle: the "before" event, able to preventDefault() and avoid the original function call at all the "after" event, in order to understand if the function did those expected changes to the environment or to a generic input object, or simply to analyze the output of the previous call the "error" event, in case we want to be notified if something went wrong during function execution the "handlerer...
Comments
Post a Comment