Browser’s Pixel Density

Firefox:
about:config, layout.css.devPixelsPerPx, change from -1.0 to something like 1.4 (it’s a string), will change immediately.

Chrome:
command-line switch to chrome.exe, use --force-device-scale-factor="1.2" (for example).

It may help you with larger screens (a.k.a HiDPI displays)
or simply to adjust your display for a better visibility.

Vary: Accept-Encoding

Specify a Vary: Accept-Encoding header

bootstrapcdn-vary-accept-encoding-2

Bugs in some public proxies may lead to compressed versions of your resources being served to users that don’t support compression. Specifying the Vary: Accept-Encoding header instructs the proxy to store both a compressed and uncompressed version of the resource.
Continue reading

Force Chrome Password Saving By Removing Event Handlers – The JSNinja Way!!!

(function (new_item) {
  document.querySelector('html').style.display="none"; //limit repaint.

  Array.prototype.forEach.call(document.querySelectorAll("*"), function (item) {
    new_item = item.cloneNode(true);
    item.parentNode.replaceChild(new_item, item);
  })

  document.querySelector('html').style.display="inherit";
}());

a more advanced method is removing the textual event-attribute,
but it is needed to be done AFTER the clone method (or all the attributes will be back… :( )

NodeList.prototype.forEach = Array.prototype.forEach;
NodeList.prototype.map = Array.prototype.map;

var attributes, new_element;

document.querySelectorAll("*").forEach(function(element){
  attributes = Object.keys(element.attributes).map(function(key_index){
    return element.attributes[key_index].nodeName
  });

  attributes = attributes.filter(function(attribute){ return 0 === attribute.toLowerCase().indexOf("on") }); /* keep similar to events */

  /* remove event-handlers (dom level 2 and 3) */
  new_element = element.cloneNode(true);
  element.parentNode.replaceChild(new_element, element);

  attributes.forEach(function(attribute){ 
    //element[attribute] = null; //remove reference to ease up memory (override with empty) - event as DOM-handle.  --not needed (clone method is more effictive)
    element.removeAttribute(attribute); //remove event text - event as attribute
  });

  
})

at this point the page (unless continuously renewing the event handlers..) is event free, placing the username, password, etc.. and submitting the form (either by submit button, which almost always has a non-ajax alternative, even on full ajax page, to better support older browsers – or executing a javascript code manually from console) will trigger Chrome’s password saving mechanism,
you are not necessarily need to be successfully logged-in,
all it means is that the login-data will be available next time you’ll be visiting the page, and then, naturally use the page without any modification (as it is)…

JavaScript Beautiful Code Part #2/3 – Proper Coding – Avoiding Implicit Type Conversion

icompile.eladkarako.com_i_always_follow_the_proper_dress_codeMaybe only best used @ the end-point compile-script) to minify/obfuscate your code even more..

point mentioning that those *might* gives you a little street credit, but are considered a really bad practice,
and in no-way you should use those in actual live-code, at least, out of common courtesy for your fellow developers :]

icompile.eladkarako.com_beautiful_code_animation

  • :( x = !!y;
  • :) x = Boolean(y);

  • :( x = +y;
  • :) x = Number(y);

  • :( x = '' + y;
  • :) x = String(y);

  • :( x = ~s.indexOf('.');
  • :) x = s.indexOf('.') !== -1;

consider reading more about:
JSCS (JavaScript Code Style)https://www.npmjs.com/package/jscs
GJSLint (Google JavaScript Linter) https://developers.google.com/closure/utilities/docs/linter_howto

if you see those abominations,
be a pal, and fix it :)

Force Save Password

Allowing the browser’s password-manager to save the login data, meaning user-name and password, even if it is in a SSL (for example https secured websites).

it is done by setting the autocomplete attribute of forms and password field to “on”.

put easily as a bookmark button (known as ‘snippet’).

add this to your bookmark (or favorites) toolbar:

javascript:(function (){var a,b,c,d,e,f,g,h,i;a=b=c=0;d=document.forms;for(f=0;f

You can look at the formatted code for better understanding:
(it is slightly different)

(function () {
    var ca, cea, cs, df, dfe, i, j, x, y;

    function n(i, what) {
        return i + " " + what + ((i == 1) ? "" : "s")
    }
    ca = cea = cs = 0;
    df = document.forms;
    for (i = 0; i < df.length; ++i) {
        x = df[i];
        dfe = x.elements;
        if (x.onsubmit) {
            x.onsubmit = "";
            ++cs;
        }
        if (x.attributes["autocomplete"]) {
            x.attributes["autocomplete"].value = "on";
            ++ca;
        }
        for (j = 0; j < dfe.length; ++j) {
            y = dfe[j];
            if (y.attributes["autocomplete"]) {
                y.attributes["autocomplete"].value = "on";
                ++cea;
            }
        }
    }
    alert("Auto-Complete Has Been Re-Applied To:\n-----------------------------------------------\nForms: " + n(ca, "form") + " .\nForms Elements: " + n(cea, "form element") + " .\nOn-Submits: " + n(cs, "form") + " .");
})();

Example Using PayPal