7z methods and compressions

7z a -t7z archive.7z -m0=LZMA2 -mx=9 -mmt=on -ssc -ssw -ms=on ../build/hosts0.txt

7z a -t7z archive.7z -m0=LZMA2 -mx=9 -mmt=on -ssc -ssw -mmem=20m *.dll
7z a -t7z archive.7z -m0=LZMA2 -mx=9 *.dll
7z a -t7z archive.7z -m0=LZMA2 -mx=9 -md=1024 -mmem=2048m -mmt=on -ssc -ssw  *.dll

compression method
LZMA2
LZMA
PPMd
BZip2

Archive format
7z
bzip2
gzip
tar
wim
xz
zip

-ms=on      use "solid archive" (entire content is like one huge-file)    (-ms=on|-ms=off)
-mmt=on     use multi-threading                                           (-mmt=on|-mmt=off)
-t7z        archive type is "7z"                        (-t7z|-tbzip2|-tgzip|-ttar|-twim|-txz|-tzip   maybe also: -tiso|-tudf)
-m0=LZMA2   use "LZMA2" compression method (algorithm)  (-m0=LZMA2|-m0=LZMA|-m0=PPMd|-m0=BZip2)
-mx=9       Ultra                                       (-mx=0|....|-mx=9)
-ssw        Compress locked files. You can try this if you have problems opening files. (-ssw-|-ssw)

SEO – Set Your Server’s Timezone Using The .htaccess-File

#####################################################
# set timezone - "UTC"|"GMT"|"Asia/Jerusalem"|etc.. #
#####################################################
<IfModule mod_env.c>
  SetEnv TZ                "Asia/Jerusalem"
</IfModule>

<IfModule php5_module>
  php_value date.timezone  "Asia/Jerusalem"
</IfModule>
#####################################################

Remove W3Schools Results From Google-Search Result Page

I’ve looked everywhere for a nice solution that will remove the ugly unuseful, crappy w3schools results from the Google-search results-page, initially I’ve used JavaScript to hide it (bookmarklet), then some enhanced JavaScript with Chrome-extension support, but the best thing you can do is don’t get any of those w3schools result in the first place,

I’ve just came up with the most simple solution: exclude the w3school domains!

Continue reading

WordPress – A Better Article DateTime

A Basic, Low-Level API Usage Of WordPress API,
That Skips Most Of The Get Time/Get Date Wrappers Of Higher-Level Of WordPress API,


$date_str = call_user_func_array(function($post_date_published, $post_date_modified){

  //$post_date = $post_date_modified;
  $post_date = $post_date_published;

  //$date = '📅 Published:  <time datetime="##DATE_c##" pubdate>##DATE_lFj##<sup>##DATE_S##</sup>##DATE_YhiA##</time> <sub>[##DATE_e##]</sub>';
  $date = '📅 <time datetime="##DATE_c##" pubdate>##DATE_lFj##<sup>##DATE_S##</sup>##DATE_YhiA##</time>';

  $date = str_replace('##DATE_c##',     mysql2date("c",          $post_date, /*date_i18n=*/false), $date);       /* HTML5 datetime uses ISO 8601 date format - for example: 2016-05-06T20:31:18+00:00 */
  $date = str_replace('##DATE_lFj##',   mysql2date("l, F j",     $post_date, /*date_i18n=*/false), $date);       /* "Friday, May 6" */
  $date = str_replace('##DATE_S##',     mysql2date("S",          $post_date, /*date_i18n=*/false), $date);       /* "th" */
  $date = str_replace('##DATE_YhiA##',  mysql2date(", Y.  g:iA", $post_date, /*date_i18n=*/false), $date);       /* ", 2016.  8:31PM" */
  //$date = str_replace('##DATE_e##',     mysql2date("e",          $post_date, /*date_i18n=*/false), $date);       /* "UTC" */
  unset($post_date);  /*cleanup*/

  //$date = str_replace(' ', '&nbsp;', $date);                                                                     /* no wrapping */

  return $date;
},[
   (string)($GLOBALS["post"] -> post_date)       /* UTC date in mySQL DATETIME format ("Y-m-d H:i:s") - for example: "2016-05-06 20:31:18" */
 , (string)($GLOBALS["post"] -> post_modified)   /* UTC date in mySQL DATETIME format ("Y-m-d H:i:s") - for example: "2016-05-06 20:31:18" */
]);

$date_str = '<span class="entry-date">' . $date_str . '</span>';

print($date_str);

On this example, the output is an HTML5-time element,
along with nice (style-less) textual output of the current date-time and timezone.

icompile.eladkarako.com_wordpress_better_datetime2

Note I:
if you don’t want to use Unicode symbol in your PHP code (for example, if you want to keep your code-pages US-ASCII, but you wish to render UTF-8..)
You can use the &#x1F4C5 (Hex NCR) or &#128197; (Decimal NCR)
and you can also add

Note II:
You can force the “emoji” symbol to render either as text or picture by adding a Unicode-variation-selector (mostly effective only on mobiles/iOS desktops)
to keep the emoji “as text” use &#x1F4C5;&#xFE0E; or &#128197;&#65038; (known as Unicode’s VARIATION SELECTOR-15).
to keep the emoji “as picture” use &#x1F4C5;&#xFE0F; or &#128197;&#65039; (known as Unicode’s VARIATION SELECTOR-16).

Again.. this, most likely, won’t change anything in Chrome (*nix/Win Desktops), only on Android devices and iOS desktops and mobile devices.

Edit: here is the “use text emoji” variation of the code above:


$date_str = call_user_func_array(function($post_date_published, $post_date_modified){

  $post_date = $post_date_published;
  //$post_date = $post_date_modified;

  //$date = '📅 Published:  <time datetime="##DATE_c##" pubdate>##DATE_lFj##<sup>##DATE_S##</sup>##DATE_YhiA##</time> <sub>[##DATE_e##]</sub>';
  //$date = '📅 <time datetime="##DATE_c##" pubdate>##DATE_lFj##<sup>##DATE_S##</sup>##DATE_YhiA##</time>';
  $date = '<span>&#x1F4C5;&#xFE0E;</span> <time datetime="##DATE_c##" pubdate>##DATE_lFj##<sup>##DATE_S##</sup>##DATE_YhiA##</time>';

  $date = str_replace('##DATE_c##',     mysql2date("c",          $post_date, /*date_i18n=*/false), $date);       /* HTML5 datetime uses ISO 8601 date format - for example: 2016-05-06T20:31:18+00:00 */
  $date = str_replace('##DATE_lFj##',   mysql2date("l, F j",     $post_date, /*date_i18n=*/false), $date);       /* "Friday, May 6" */
  $date = str_replace('##DATE_S##',     mysql2date("S",          $post_date, /*date_i18n=*/false), $date);       /* "th" */
  $date = str_replace('##DATE_YhiA##',  mysql2date(", Y.  g:iA", $post_date, /*date_i18n=*/false), $date);       /* ", 2016.  8:31PM" */
  //$date = str_replace('##DATE_e##',     mysql2date("e",          $post_date, /*date_i18n=*/false), $date);       /* "UTC" */
  unset($post_date);  /*cleanup*/

  //$date = str_replace(' ', '&nbsp;', $date);                                                                     /* no wrapping */

  return $date;
},[
   (string)($GLOBALS["post"] -> post_date)       /* UTC date in mySQL DATETIME format ("Y-m-d H:i:s") - for example: "2016-05-06 20:31:18" */
 , (string)($GLOBALS["post"] -> post_modified)   /* UTC date in mySQL DATETIME format ("Y-m-d H:i:s") - for example: "2016-05-06 20:31:18" */
]);

$date_str = '<span class="entry-date">' . $date_str . '</span>';

print($date_str);

I’ve took a screenshot of my phone’s screen,

icompile.eladkarako.com_wordpress_better_datetime_text_picture_emoji_unicode

as you can see- the places where there is no variation-selector-15 addition (such as the PHP code) – the Unicode text-emoji was replaced to a picture,
but at the bottom of the article, where I’ve used the extra-variation-selector-15 addition, the emoji was kept a nice little monochrome text symbol, nice!

Prevent Skype-Click2Call Toolbar From Breaking Your Website

If your website viewers have Skype installed the Skype Internet Explorer Toolbar with wreak havoc on your websites, in case it (Skype’s browser-extension) discovers any sort of data which resembles a phone number, it will then edit the HTML around the text to a hyperlink, making it clickable, and when clicked the main Skype application on your PC (or mobile) will open.

Include the following meta tag to prevent this action.

<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">

*Oh and apparently both the name and content are case-sensitive (if won’t work if you’ll use "skype_toolbar"/"skype_toolbar_parser_compatible" :]
Edit:*Also- it is HARD-CODED @Skype in a way you must use meta-name-content and will NOT work if you’re to be putting the content before the name :]]
–Edit:**ALSO! – it won’t work if you’ll to be put a self-closing slash at the end: /> you MUST use > :]]]
—Edit:***G.Damn it!!!! it won’t work if you put a space before the >…. essentially copy the line above :]]]]

icompile.eladkarako.com_prevent_skype_toolbar_html_modifications

… :]]]]]

…ANYWAY…….

If you DO wish to pre-specify your contact telephone-number to be Skype-compatible (I guess it is useful if you are sort of seller/retailer)

<!-- sphoneid telnr="+972123456789" fileas="firstname lastname" -->+972-12-345-6789<!-- sphoneid -->

You might as well add the following meta-tag, to avoid all sort of (other) unintentional “”content-discovering””..

<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no" />

(You may customize the limitation by removing telephone/date/address/email/url from the content attribute)

JavaScript – Dynamic Resources Loading-Error Handling

Some time ago I’ve wrote the article HTML5 Image Loading Error Handling, although quite simple solution, foucsing on self-contained, more simple solution using an inline event-handling to hide images with specific width/height set, to avoid dirtying up the UI with “empty squares”.

I’ve recently embedded a YouTube video (which uses an iframe), I’ve noticed that for some reason it wasn’t shown on mobile devices, although it should show the “poster”-of the video the very least, nothing was shown but an empty frame,

So I’ve thought I could reuse the previous solution for iframe-elements too,
and to make it easier to use I’ll make it dynamic,
– but will KEEP using an inline-event-handlers instead of settings various handlers to the DOM/node representative of the element.

In short, we’ll be looking for IMG or IFRAME elements that were not already configured with inline-onerror/ontimeout attribute,
and write a little code to hide it, in-case of a loading-error. Simple.

Array.prototype.forEach.call(document.querySelectorAll('img:not([onerror]),iframe:not([onerror])'),function(e){e.setAttribute("onerror","this.style.display=\\\"none\\\";");});

And:

Array.prototype.forEach.call(document.querySelectorAll('img:not([ontimeout]),iframe:not([ontimeout])'),function(e){e.setAttribute("ontimeout","this.style.display=\\\"none\\\";");});

Loading those two lines can be done using a SCRIPT tag, but I can do even better:
instead of:

<script type="text/javascript">
  Array.prototype.forEach.call(document.querySelectorAll('img:not([onerror]),iframe:not([onerror])'),function(e){e.setAttribute("onerror","this.style.display=\\\"none\\\";");});
  Array.prototype.forEach.call(document.querySelectorAll('img:not([ontimeout]),iframe:not([ontimeout])'),function(e){e.setAttribute("ontimeout","this.style.display=\\\"none\\\";");});
</script>

Which is a “BLOCKERblock” (first “block” as in “you shall not pass”, second “block” as a lego-block or a code-block, ..a chunk essentially..)

There is a nice little trick which is to base64-encode the content and use a script as if loading a remote resource, with the addition of async and defer (so the script will load after the page has done loading, and it is not really important in the loading order to be blocking the main thread :] ).

This is the end result

<!-- add ONERROR and ONTIMEOUT attribute to all IMG and IFRAME elements (if not already have one) -->
<script async defer type="application/javascript" src="data:application/javascript;charset=UTF-8;base64,QXJyYXkucHJvdG90eXBlLmZvckVhY2guY2FsbChkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdpbWc6bm90KFtvbmVycm9yXSksaWZyYW1lOm5vdChbb25lcnJvcl0pJyksZnVuY3Rpb24oZSl7ZS5zZXRBdHRyaWJ1dGUoIm9uZXJyb3IiLCJ0aGlzLnN0eWxlLmRpc3BsYXk9XFxcIm5vbmVcXFwiOyIpO30pOwpBcnJheS5wcm90b3R5cGUuZm9yRWFjaC5jYWxsKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2ltZzpub3QoW29udGltZW91dF0pLGlmcmFtZTpub3QoW29udGltZW91dF0pJyksZnVuY3Rpb24oZSl7ZS5zZXRBdHRyaWJ1dGUoIm9udGltZW91dCIsInRoaXMuc3R5bGUuZGlzcGxheT1cXFwibm9uZVxcXCI7Iik7fSk7Cg=="></script>

You can [also] click the following link to see that your browser open up the tab and showing the javascript’s plain text (which is kind’a cool..)
data:application/javascript;charset=UTF-8;base64,QXJyYXkucHJvdG90eXBlLmZvckVhY2guY2FsbChkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdpbWc6bm90KFtvbmVycm9yXSksaWZyYW1lOm5vdChbb25lcnJvcl0pJyksZnVuY3Rpb24oZSl7ZS5zZXRBdHRyaWJ1dGUoIm9uZXJyb3IiLCJ0aGlzLnN0eWxlLmRpc3BsYXk9XFxcIm5vbmVcXFwiOyIpO30pOwpBcnJheS5wcm90b3R5cGUuZm9yRWFjaC5jYWxsKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2ltZzpub3QoW29udGltZW91dF0pLGlmcmFtZTpub3QoW29udGltZW91dF0pJyksZnVuY3Rpb24oZSl7ZS5zZXRBdHRyaWJ1dGUoIm9udGltZW91dCIsInRoaXMuc3R5bGUuZGlzcGxheT1cXFwibm9uZVxcXCI7Iik7fSk7Cg==

Enable HTTP/2 On Chrome

There are several interesting switches I have located in the Chromium/Chrome code lately:

  • // Disable SPDY/3.1. This is a temporary testing flag.
    const char kDisableSpdy31[]                 = "disable-spdy31";
    
  • // Enable SPDY/4, aka HTTP/2. This is a temporary testing flag.
    const char kEnableSpdy4[]                   = "enable-spdy4";
    
  • // Uses WebSocket over SPDY.
    const char kEnableWebSocketOverSpdy[]       = "enable-websocket-over-spdy";
    
  • // Uses Spdy for the transport protocol instead of HTTP. This is a temporary
    // testing flag.
    const char kUseSpdy[]                       = "use-spdy";
    

If you would like to give HTTP/2 a go, you are welcome to use those switches by adding a prefix of --, in that orderly fashion:

C:\Users\Elad\AppData\Local\Chromium\Application\chrome.exe --disable-spdy31 --enable-spdy4 --enable-websocket-over-spdy --use-spdy

Assuming your name is Elad too ;)

Microsoft URLS Used By Background Services You Can-Not Block With HOSTS-File

Blocking or routing URL-addresses using the HOSTS-file is quite and easy practice to master,
Here are few of Microsoft’s URL-addresses, used by background-services,
That would not “pass-through” the standard-HOSTS file DNS resolution, which means, that
trying to “block” (127.0.0.* with no internal-server running, or 0.0.0.0) or redirect those will do little to none..

  1. www.msdn.com
  2. msdn.com
  3. www.msn.com
  4. msn.com
  5. go.microsoft.com
  6. msdn.microsoft.com
  7. office.microsoft.com
  8. microsoftupdate.microsoft.com
  9. wustats.microsoft.com
  10. support.microsoft.com
  11. www.microsoft.com
  12. microsoft.com
  13. update.microsoft.com
  14. download.microsoft.com
  15. microsoftupdate.com
  16. windowsupdate.com
  17. windowsupdate.microsoft.com

You can find the dnsapi.dll under this path: C:\Windows\System32\dnsapi.dll

icompile.eladkarako.com_microsoft_urls_used_by_background_services_you_can_not_block_with_hosts_file

You can still block those using this router trick: iCompile – Easy Router Ad-Block

Since it still uses the DNS-engine, just ignores any redirects from HOSTS.

Apache .htaccess Entry For Serving Correct MimeType For Some Of The More Common File-Types

Put this part in your .htaccess to make sure your files are served with correct mimetype, and will eventually trigger the target-browser/OS, proper, handler.

<IfModule mod_mime.c> 
  AddType application/font-woff                  woff
  AddType application/javascript                 js
  AddType application/octet-stream               safariextz
  AddType application/vnd.ms-fontobject          eot
  AddType application/x-chrome-extension         crx
  AddType application/x-font-ttf                 ttf ttc
  AddType application/x-font-woff                woff
  AddType application/x-mpegurl                  m3u8
  AddType application/x-xpinstall                xpi
  AddType audio/mp4                              m4a
  AddType audio/mpeg                             mp3
  AddType audio/ogg                              oga ogg
  AddType font/opentype                          otf
  AddType image/webp                             webp
  AddType image/x-icon                           ico
  AddType text/cache-manifest                    appcache manifest
  AddType text/plain                             srt sub ssa
  AddType text/vtt                               vtt
  AddType text/x-component                       htc
  AddType text/x-vcard                           vcf
  AddType video/3gpp                             3gp
  AddType video/mp2t                             ts
  AddType video/mp4                              mp4 m4v
  AddType video/ogg                              ogv ogg
  AddType video/quicktime                        mov
  AddType video/x-ms-wmv                         wmv
  AddType video/webm                             webm
  AddType video/x-flv                            flv
  AddType video/x-msvideo                        avi

  # Web application-manifests.  [https://github.com/mdn/to-do-notifications/blob/gh-pages/.htaccess]
  AddType application/x-web-app-manifest+json    webapp

  # SVG.
  #   Required for svg webfonts on iPad [twitter.com/FontSquirrel/status/14855840545]
  AddType image/svg+xml                          svg svgz 
  AddEncoding gzip                               svgz
</IfModule>

JavaScript Snippet – Specific Base64 Bookmarklet

javascript:(function(text, mimetype){
  mimetype = null === mimetype ? '' : mimetype; /* normalize variable value to STRING (in-case of 'prompt' error)               */

  text =  btoa(                                 /* ASCII(or byte string) to BASE64                                              */
            unescape(encodeURIComponent(        /* trick to make 'btoa' safe for Unicode::: converts any string to byte-string. */
              text
            ))
          );
  
  text = mimetype + text;

  console.dir(                                  /* non trimmable output                                                         */
    text
  );

}(
  document.querySelector('body').innerText
, prompt('mimetype?','data:text/plain;charset=UTF-8;base64,')
));

This one is VERY SPECIFIC to assist ME in some repeating tasks for one of my web-app(s),
taking a text-based file and converting it to base64 is quite-easy, but includes a lot of steps… (you can see the [c#] base64 console, by searching my-website..)

But, by copying the content of a text file (js, html, plain text, etc…) and pasting it to bin.eladkarako.com,
I can run the code above to output the text-only, unescaped-form (unmodified), with full Unicode support, to the console. No need of writing any files :]

I’m using console.dir as an alternative to console.log, since console.log will not trim the output :)

bookmarklet version:

javascript:(function(text,mimetype){mimetype=null===mimetype?"":mimetype;text=btoa(unescape(encodeURIComponent(text)));text=mimetype+text;console.dir(text)})(document.querySelector("body").innerText,prompt("mimetype?","data:text/plain;charset=UTF-8;base64,"));

icompile.eladkarako.com_base64_body_inner_text

New WordPress Plugin – TagClass-B-Gone

Do you have a lot of TAGs set to your post?
Well WordPress will add a class for each one to your post class-list,
effectively filling your page with a LOT of junk in form of tag(dash)*****

icompile.eladkarako.com_wordpress_tag_class_before

I find it useless.

So I’ve wrote a WordPress plugin to fix-it.
Continue reading

JavaScript Snippet – Robtex.com Sorted Lists

This nice little code, walks-through the lists on the page,
sort them and rewrite them as plain-text,
making them somewhat more easier to browse, and select/copy content.

icompile.eladkarako.com_robtex_before

icompile.eladkarako.com_robtex_work_in_progress

icompile.eladkarako.com_robtex_work_in_progress_parallel

icompile.eladkarako.com_robtex_done_plus_selection

javascript:(function (body,style,style_text){
    NodeList.prototype.forEach = Array.prototype.forEach;
    NodeList.prototype.map = Array.prototype.map;

    style.appendChild(style_text);
    body.appendChild(style);
    
    document.querySelectorAll("ol").forEach(function(ol){
      ol.setAttribute('state','work');

      /* use element as an object, storing data as variable, while clearing the DOM related data. */
      ol.lis = ol.querySelectorAll("li")
                 .map(function(li){ return li.innerText.toLowerCase() })
                 .sort()
                 ;
      ol.lis = "<li>" + ol.lis.join("</li><li>") + "</li>";

      ol.innerHTML = "";

      setTimeout(function(){
        ol.setAttribute("contentEditable", "true"); /* to support [CTRL]+[A] */
        ol.innerHTML = ol.lis;
        ol.setAttribute('state','done');
      }, 50);
    });
}(
  document.querySelector("body")
, document.createElement("style")
, document.createTextNode('/*<![CDATA[*/'
                        + 'ol[state="work"]:before{content:"working..."; font-size:20pt;}'
                        + 'ol[state="work"]{background:none rgba(255,127,137,.6); color:rgba(0,0,0,.1);}'
                        + 'ol[state="done"]{background:none rgba(147,255,72,.1); font-size: 12pt; letter-spacing:.5pt; line-height:16pt;}'
                        + 'ol[state="done"] li{font-family: "Courier New", monospace;}'
                        + '/*]]>*/')
));

and a bookmarklet version:

javascript:(function(body,style,style_text){NodeList.prototype.forEach=Array.prototype.forEach;NodeList.prototype.map=Array.prototype.map;style.appendChild(style_text);body.appendChild(style);document.querySelectorAll("ol").forEach(function(ol){ol.setAttribute("state","work");ol.lis=ol.querySelectorAll("li").map(function(li){return li.innerText.toLowerCase();}).sort();ol.lis="<li>"+ol.lis.join("</li><li>")+"</li>";ol.innerHTML="";setTimeout(function(){ol.setAttribute("contentEditable","true");ol.innerHTML=ol.lis;ol.setAttribute("state","done")},50)})})(document.querySelector("body"),document.createElement("style"),document.createTextNode('/*<![CDATA[*/ol[state="work"]:before{content:"working...";font-size:20pt;}ol[state="work"]{background:none rgba(255,127,137,.6);color:rgba(0,0,0,.1);}ol[state="done"]{background:none rgba(147,255,72,.1);font-size:12pt;letter-spacing:.5pt;line-height:16pt;}ol[state="done"] li{font-family:"Courier New",monospace;}/*]]>*/'));

New WordPress Plugin – Script-Style-Killer

WordPress loads many scripts and styles, (jQuery core and various-jQuery-plugins are few of the major ones)
in-case you don’t really need them, I’ve wrote a plugin that will “kill” (remove from the HTML, in a very unforgiving way..),
this without the need to dig into the WordPress-API itself.

Track the added script and styles added to your page, by copy&pasting the following code into your template (use any FTP-client for that), just don’t forget to remove it after you’ll be done with-it.
Continue reading

JavaScript Snippet – WordPress Window-Messaging Semi-Safe Example

/**
 * WordPress inline HTML embed
 *
 * @since 4.4.0
 *
 * This file cannot have ampersands in it. This is to ensure
 * it can be embedded in older versions of WordPress.
 * See https://core.trac.wordpress.org/changeset/35708.
 */
(function ( window, document ) {
	'use strict';

	var supportedBrowser = false,
		loaded = false;

		if ( document.querySelector ) {
			if ( window.addEventListener ) {
				supportedBrowser = true;
			}
		}

	window.wp = window.wp || {};

	if ( !! window.wp.receiveEmbedMessage ) {
		return;
	}

	window.wp.receiveEmbedMessage = function( e ) {
		var data = e.data;
		if ( ! ( data.secret || data.message || data.value ) ) {
			return;
		}

		if ( /[^a-zA-Z0-9]/.test( data.secret ) ) {
			return;
		}

		var iframes = document.querySelectorAll( 'iframe[data-secret="' + data.secret + '"]' ),
			blockquotes = document.querySelectorAll( 'blockquote[data-secret="' + data.secret + '"]' ),
			i, source, height, sourceURL, targetURL;

		for ( i = 0; i < blockquotes.length; i++ ) {
			blockquotes[ i ].style.display = 'none';
		}

		for ( i = 0; i < iframes.length; i++ ) {
			source = iframes[ i ];

			if ( e.source !== source.contentWindow ) {
				continue;
			}

			source.removeAttribute( 'style' );

			/* Resize the iframe on request. */
			if ( 'height' === data.message ) {
				height = parseInt( data.value, 10 );
				if ( height > 1000 ) {
					height = 1000;
				} else if ( ~~height < 200 ) {
					height = 200;
				}

				source.height = height;
			}

			/* Link to a specific URL on request. */
			if ( 'link' === data.message ) {
				sourceURL = document.createElement( 'a' );
				targetURL = document.createElement( 'a' );

				sourceURL.href = source.getAttribute( 'src' );
				targetURL.href = data.value;

				/* Only continue if link hostname matches iframe's hostname. */
				if ( targetURL.host === sourceURL.host ) {
					if ( document.activeElement === source ) {
						window.top.location.href = data.value;
					}
				}
			}
		}
	};

	function onLoad() {
		if ( loaded ) {
			return;
		}

		loaded = true;

		var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ),
			isIE11 = !!navigator.userAgent.match( /Trident.*rv:11\./ ),
			iframes = document.querySelectorAll( 'iframe.wp-embedded-content' ),
			iframeClone, i, source, secret;

		for ( i = 0; i < iframes.length; i++ ) {
			source = iframes[ i ];

			if ( source.getAttribute( 'data-secret' ) ) {
				continue;
			}

			/* Add secret to iframe */
			secret = Math.random().toString( 36 ).substr( 2, 10 );
			source.src += '#?secret=' + secret;
			source.setAttribute( 'data-secret', secret );

			/* Remove security attribute from iframes in IE10 and IE11. */
			if ( ( isIE10 || isIE11 ) ) {
				iframeClone = source.cloneNode( true );
				iframeClone.removeAttribute( 'security' );
				source.parentNode.replaceChild( iframeClone, source );
			}
		}
	}

	if ( supportedBrowser ) {
		window.addEventListener( 'message', window.wp.receiveEmbedMessage, false );
		document.addEventListener( 'DOMContentLoaded', onLoad, false );
		window.addEventListener( 'load', onLoad, false );
	}
})( window, document );

Pixel Image Serving And Google’s ModPageSpeed – Quick Checklist

This is all about PIXEL-IMAGES,

While pixel-images themselves are all about an out-going request,
with little to none caring of the actual response –

– Due to compatibility issues, browser pre-rendering enhancements,
mimetype-sniffing, client-side caching, cross-domain limitations,
and content/visibility base loading such as lazy-loading and content-deferring

– In most cases we actually need to, also, (ridiculously) ensure that the pixel-image has rendered perfectly.

Continue reading

eBay Bad Sellers

There are plenty of “Bad-Buyers” websites,
for sellers to be adding to their “ignore list”,
but not much of (if any) “bad seller” lists,

From time to time you hear of a seller that sends partial-delivery,
Or even avoid sending anything at all (especially if you place a very small order),
After two or three months when you’ll send them a message,
They will act *all “surprised”* and if you are lucky you might get your money back,
that is, if they will bothered to answer you at all,
and it wasn’t too long until you’ve opened a case with either eBay/PayPal.

why wouldn’t you just avoid that scenario at all?
apparently my other article JavaScript Ninja – Crowd Wisdom eBay Enhancements was so popular, that I’ve actually got address by few of my blog-readers,
sharing some ‘horror’-stories about recent purchases,
We’ve had a new idea:

A seller blacklist

Nasty s.o.b sellers list Updated: July 27, 2016

12deeping
47st.photo
5starsvipstore
7-39158
av-rf
babastoreong
beautyzz2009
benjeans2015
bessky_store
best4noone
bib-queen
btlife
buyincoins_au
cagoqra
cherrystore2012
clickkey
craftmentools
cskwin2015
elgb16
fashion-trench
fashionwomensale
gelivable.2u
guoqca0
haoadp123
happygreenshopteam
horse3109
iluckydog
incellworldukltd
jinbostore
jinshan2013
kingsing6688
misszhou2013
misszt1983
my_dream1960
nihaomayun
olyhome
onedot1
onsalezone2012
roseforyou_nice
sale4women
service2worldwide
shuli8882012
smartphonestation
sseariver2009
stungun112
sunnyshop06
tiger.vzu
tinaforyou
toquedarte
traveleroutdoor
wholesaleuk
yur1924
zysysy2012

apparently you CAN block sellers, but it requires some accessing to eBay advance-search,
any copy-pasting a long-list of bad-sellers with an “exclude” category. Too complex for everyday use.

Here comes the JavaScript Magic :]

* [CTRL]+[A] Friendly *

(function(search_url, blacklist_sellers, search_for, ignore_from, window){
  blacklist_sellers = blacklist_sellers.join(',');
  
  blacklist_sellers = encodeURIComponent(blacklist_sellers);
  search_for        = encodeURIComponent(search_for);
  ignore_from       = encodeURIComponent(ignore_from);
  
  search_url        = search_url  .replace( '##BLACKLIST_SELLERS##', blacklist_sellers)
                                  .replace( '##SEARCH_FOR##',        search_for)
                                  .replace( '##IGNORE_FROM##',       ignore_from)
                                  ;

  window.location.replace(search_url);
}(
"http://www.ebay.com/sch/i.html?_in_kw=1&_sacat=0&_udlo=&_udhi=&LH_BIN=1&LH_ItemCondition=3&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_stpos=&_sargn=-1%26saslc%3D1&_salic=1&_fss=1&_fsradio=%26LH_SpecificSeller%3D1&_saslop=2&_sop=12&_dmd=1&_sadis=15&_ipg=200&_sasl=##BLACKLIST_SELLERS##&_nkw=##SEARCH_FOR##&_ex_kw=##IGNORE_FROM##"
, 
  [ '12deeping' 
  , '47st.photo' 
  , '5starsvipstore' 
  , '7-39158' 
  , 'av-rf' 
  , 'babastoreong' 
  , 'beautyzz2009' 
  , 'benjeans2015' 
  , 'bessky_store' 
  , 'best4noone' 
  , 'bib-queen' 
  , 'btlife' 
  , 'buyincoins_au' 
  , 'cagoqra' 
  , 'cherrystore2012' 
  , 'clickkey' 
  , 'craftmentools' 
  , 'cskwin2015' 
  , 'elgb16' 
  , 'fashion-trench' 
  , 'fashionwomensale' 
  , 'gelivable.2u' 
  , 'guoqca0' 
  , 'haoadp123' 
  , 'happygreenshopteam' 
  , 'horse3109' 
  , 'iluckydog' 
  , 'incellworldukltd' 
  , 'jinbostore' 
  , 'jinshan2013' 
  , 'kingsing6688' 
  , 'misszhou2013' 
  , 'misszt1983' 
  , 'my_dream1960' 
  , 'nihaomayun' 
  , 'olyhome' 
  , 'onedot1' 
  , 'onsalezone2012' 
  , 'roseforyou_nice' 
  , 'sale4women' 
  , 'service2worldwide' 
  , 'shuli8882012' 
  , 'smartphonestation' 
  , 'sseariver2009' 
  , 'stungun112' 
  , 'sunnyshop06' 
  , 'tiger.vzu' 
  , 'tinaforyou' 
  , 'toquedarte' 
  , 'traveleroutdoor' 
  , 'wholesaleuk' 
  , 'yur1924' 
  , 'zysysy2012' 
  ]
, 
  prompt("Search For..","good")
,
  prompt("Ignore From\n(for 2 or more use a comma)", "bad,ugly")
, 
  top
));

and- a bookmarklet version that you can made into a clickable button,

javascript:(function(a,b,c,d,e){b=b.join(","),b=encodeURIComponent(b),c=encodeURIComponent(c),d=encodeURIComponent(d),a=a.replace("##BLACKLIST_SELLERS##",b).replace("##SEARCH_FOR##",c).replace("##IGNORE_FROM##",d),e.location.replace(a)}("http://www.ebay.com/sch/i.html?_in_kw=1&_sacat=0&_udlo=&_udhi=&LH_BIN=1&LH_ItemCondition=3&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_stpos=&_sargn=-1%26saslc%3D1&_salic=1&_fss=1&_fsradio=%26LH_SpecificSeller%3D1&_saslop=2&_sop=12&_dmd=1&_sadis=15&_ipg=200&_sasl=##BLACKLIST_SELLERS##&_nkw=##SEARCH_FOR##&_ex_kw=##IGNORE_FROM##",["12deeping","47st.photo","5starsvipstore","7-39158","av-rf","babastoreong","beautyzz2009","benjeans2015","bessky_store","best4noone","bib-queen","btlife","buyincoins_au","cagoqra","cherrystore2012","clickkey","craftmentools","cskwin2015","elgb16","fashion-trench","fashionwomensale","gelivable.2u","guoqca0","haoadp123","happygreenshopteam","horse3109","iluckydog","incellworldukltd","jinbostore","jinshan2013","kingsing6688","misszhou2013","misszt1983","my_dream1960","nihaomayun","olyhome","onedot1","onsalezone2012","roseforyou_nice","sale4women","service2worldwide","shuli8882012","smartphonestation","sseariver2009","stungun112","sunnyshop06","tiger.vzu","tinaforyou","toquedarte","traveleroutdoor","wholesaleuk","yur1924","zysysy2012"],prompt("Search For..","good"),prompt("Ignore From\n(for 2 or more use a comma)","bad,ugly"),top));

What it does?
– asks you for your search term,
– asks you for “ignore from” – words (you can include infinite amount of phrases, separated by comma)

the script above combines a list of bad sellers with your entered data,
and execute a search, instead of you, entering the whole thing by hand.

Hope it help :]