UnFuck Crayon-Syntax-Highlighter

Crayon-Syntax-Highlighter is a horrible (horrible!) piece of code.

The following code will convert it into a lovely,
JavaScript-free and easy-to-copy container.

Continue reading

GoDaddy Portal Requires JS Support.

GoDaddy website login, now (well.. a week ago the update was pushed to production) requires a full JavaScript support, so if you’ve disabled JavaScript for the portal, you’ll have to re-enable it, in-order to use the website as-is..
The GoDaddy admin-login page, used to relay on HTML login, but now it is 100% JavaScript-rendering (“login-ticket”).

:/

Schema For Your EXE

<?xml version="1.0" encoding="utf-8"?>
<assembly  manifestVersion="1.0"
           xmlns="urn:schemas-microsoft-com:asm.v1"
           xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
           xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
           xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!-- name:                   unique format, or file-name.exe (Required).
       processorArchitecture:  (x86|ia64|amd64), you can remove it for application or put "*" instead for application or dependency (Optional).
       version:                mmmmm.nnnnn.ooooo.ppppp format, 0-65535 inclusive (Required).
       publicKeyToken:         "0000000000000000" (16x0-F) the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. The public key used to sign the catalog must be 2048 bits or greater. Required for all shared side-by-side assemblies, optional for the application itself.
   -->
  <assemblyIdentity  name="Microsoft.Windows.Shell.calc"
                     processorArchitecture="amd64"
                     version="1.0.0.0"
                     type="Win32"
                     />
  <description>Windows Shell</description>

  <application xmlns="urn:schemas-microsoft-com:asm.v3">
      <windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
          <!-- dpiAware>true</dpiAware -->
          <dpiAware>True/PM</dpiAware>                              <!-- DPI aware: system-global DPI (Vista-8.0) or per-screen DPI (Win8.1/10). -->
          <dpiAwareness>PerMonitorV2, unaware</dpiAwareness>        <!-- overrides "dpiAware" when available, request the more friendly extended "per screen dpi support". -->
          <disableWindowFiltering>true</disableWindowFiltering>     <!-- be able to enumerate immersive windows from the desktop (Windows 8.0+ supports it - lower versions ignore it. -->
          <gdiScaling>true</gdiScaling>                             <!-- try to support text elements (not graphics) DPI, can help old applications to have proper DPI support. Remove if breaks app's look (huge text overflows in small elements is the most common problem) -->
          <printerDriverIsolation>true</printerDriverIsolation>     <!-- keep it! on Win7+/Server2008R2+ - the app won't crash if the printer driver has an error ( enabling printer drivers to run in processes that are separate from the process in which the print spooler runs). -->
          <!-- autoElevate>false</autoElevate -->                   <!-- 'true' means that - when needed - Windows will pop-up UAC to get admin-permission and up-until-then it will run in the standard permissions. Try to avoid using 'true' - the best practice is simply, explicitly, using '<requestedExecutionLevel level="requireAdministrator"..' from the very start, it will also make you app faster. -->
          <disableTheming>false</disableTheming>                    <!-- 'true' will disable theme support, use it if your app has its "own theme system" and you want to save some handlers on your app-window ;] -->
      </windowsSettings>
  </application>

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>                                              <!-- UAC Manifest Options: Specifying requestedExecutionLevel node will disable file and registry virtualization. If you want to utilize File and Registry Virtualization for backward compatibility then delete all of the requestedExecutionLevel nodes. -->
        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>    <!-- level=(asInvoker|requireAdministrator|highestAvailable), uiAccess is unlimited-control app must be signed and placed in a "safe-location" path such as Program Files. -->
      </requestedPrivileges>
    </security>
  </trustInfo>

  <dependency>
    <dependentAssembly>
      <assemblyIdentity  name="Microsoft.Windows.Common-Controls" 
                         publicKeyToken="6595b64144ccf1df" 
                         processorArchitecture="*" 
                         version="6.0.0.0" 
                         type="win32" 
                         language="*" 
                         />
    </dependentAssembly>
  </dependency>

  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">  <!-- what application supports. Windows will automatically select the most compatible environment.  -->
    <application>
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>      <!-- Windows Vista             / Server 2008     -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>      <!-- Windows 7                 / Server 2008 R2  -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>      <!-- Windows 8                 / Server 2012     -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>      <!-- Windows 8.1 ("Blue")      / Server 2012 R2  -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>      <!-- Windows 10  ("Threshold") / Server 2016     -->
    </application>
  </compatibility>


<!--
╔══════════════════════════════════════════════════════════════════════════════════════╗
║ References                                                                           ║
╟──────────────────────────────────────────────────────────────────────────────────────╢
║ "Application Manifests":                                                             ║
║   https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191(v=vs.85).aspx    ║
║ "Schema For Your EXE":                                                               ║
║   http://icompile.eladkarako.com/schema-for-your-exe/                                ║
║ "Manifest Generation in Visual Studio":                                              ║
║   https://msdn.microsoft.com/en-us/library/ms235229.aspx                             ║
║ "Targeting your application for Windows"                                             ║
║   https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx    ║
╚══════════════════════════════════════════════════════════════════════════════════════╝
-->
</assembly>

You can edit the code above,

and click me, to update the minified code below.

Minified version:

<?xml version="1.0" encoding="utf-8"?><assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><assemblyIdentity name="Microsoft.Windows.Shell.calc" processorArchitecture="amd64" version="1.0.0.0" type="Win32"/><description>Windows Shell</description><application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>True/PM</dpiAware><dpiAwareness>PerMonitorV2, unaware</dpiAwareness><disableWindowFiltering>true</disableWindowFiltering><gdiScaling>true</gdiScaling><printerDriverIsolation>true</printerDriverIsolation><disableTheming>false</disableTheming></windowsSettings></application><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges></security></trustInfo><dependency><dependentAssembly><assemblyIdentity name="Microsoft.Windows.Common-Controls" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" version="6.0.0.0" type="win32" language="*"/></dependentAssembly></dependency><compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application><supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/><supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/><supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/><supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/></application></compatibility></assembly>


See: Compile Schema-Manifest For EXE,
for a nice trick on how to include it in your application, without the need for an IDE.

HTML5 Canvas Clear

function canvas_clear(canvas){      //clear canvas' path and content, reset tranform. return reference to same object.
  var context = canvas.getContext("2d");
  context.beginPath();
  context.setTransform(1, 0, 0, 1, 0, 0);
  context.clearRect(0, 0, canvas.width, canvas.height);
//canvas.width = canvas.width; //don't use!
  return canvas;
};

function canvas_clear_deep(canvas){       //clear canvas' path and content, reset tranform (as before).
  var tmp = canvas.cloneNode(true);       //  + NEW: unhook event-handlers (optional: attribute-events too)
                                          //  + update DOM with fresh-canvas.
                                          //  + clear unused memory.
                                          //  + return reference to fresh-canvas.

  /* //optionally enable this part to also remove inline(attribute)-events.
  NamedNodeMap.prototype.forEach = Array.prototype.forEach;     //optionally unhook inline(""attribute"")-event
  tmp.attributes.forEach(function(attribute){
                           if(false === /^on/i.test(attribute.nodeName)) return;
                           tmp.removeAttribute(attribute.nodeName);
                         });
  */

  tmp = canvas_clear(tmp);
  if(null !== canvas.parentElement){  //replace with fresh-canvas
    canvas.parentElement.replaceChild(tmp, canvas);
  }

  //cleanup
  canvas = canvas_clear(canvas);
  canvas = undefined;

  return tmp;
};

HTMLCanvasElement.prototype.clear      = function(){ return canvas_clear(this);      };
HTMLCanvasElement.prototype.clear_deep = function(){ return canvas_clear_deep(this); };

Also available on this gist: https://gist.github.com/eladkarako/a005225594ade65347e2f5ad4c55d131

And just use canvas.clear() or canvas.clear_deep() :]

Enjoy!

Yet Another Escape To Unicode

Preserve the full-meaning of the string, without encoding or breaking Unicode-pairs.

String.prototype.map                = Array.prototype.map;
String.prototype.to_char_code       = function(){ return (this+"").map(function(c){                return c.charCodeAt(0)                                                  });           };
String.prototype.escape_to_unicode  = function(){ return (this+"").to_char_code().map(function(i){ return "\u005Cu" + ("0000" + i.toString(16).toUpperCase()).substr(-4);  }).join("");  };

//test- run:   "שh🐀".escape_to_unicode();

another variation is using regular-expressing with attention to Unicode, meaning /u,
but it won’t work for you since you, still, might get a Unicode-pair (where you have to run charCodeAt(0) and charCodeAt(1).. etc…). Split by character (I’m using Array.map, but it is the same as using split("").map(...) will work around that, keeping the character whole (meaning not like the Unicode/ASCII-escape trick) but still breaking nicely characters, including breaking Unicode-pairs-
-to quickly get the \u.. equivalent of your string. :]

Quick eBay Search- From Your Address-Bar!

Add eBay to your address-bar search-engines,
and search faster and more secure.

You can access you address-bar search-engines,
by right-click the address bar and selecting “Edit search-engines”

or copy&paste: chrome://settings/searchEngines into your address-bar, and pressing ENTER.

..Either way..

Here is few of the switches used in eBay search-engine:

https://www.ebay.com/sch/i.html?
&LH_ItemCondition=3         item condition: 'new'
&_ipg=200                   '200' results per page
&_udlo=3                    minimum is 3$ (or if you are logged-in, it will use 3-of-'your currency')
&_udhi                      unlimited maximum amount of $ (your currency)
&LH_BIN=1                   limit to 'buy now' items
&_nkw=%s                    the actual search phrase

You should clear up everything you do not need (it will speed up your Chrome..)
and especially everything that looks like “ebay” or “ebay.com”.

add a new line,
looking something like this:
https://www.ebay.com/sch/i.html?LH_ItemCondition=3&_ipg=200&_udlo=3&LH_BIN=1&_nkw=%s

Hit ENTER (and do not click the “make default”..)
now all you have to do is start writing ebay, followed by space,
to have yourself a personal search-engine,

it will (try) to use HTTPS, to load eBay from secure location,
and will save you clicking the “new” state and other checkboxes…
it will also reduce the tracking eBay uses as an additional arguments in the search-url.

You can remove/modify the switches, finding-out new-ones by
investigating eBay yourself, or look for iCompile, for eBay articles.

Enjoy!

JavaScript Ninja – String Encryption, Easily!

  • Keeping some data in your JavaScript source, is unavoidable,
    it is best to keep it at-least, somewhat obfuscated.
  • Here is a simple string encrypt/decrypt function.
  • First run the function with your plain-text, to encrypt it.
    Next, store both the function and the encrypted text in your source-code.
    Need the plain-text again?
    Run the function again, but this time: on your encrypted text!
    to get the plain-text back.
  • The function is added to the String prototype for an easy access.
  • The Code:

    String.prototype.normalise_to_ascii   = function(){return unescape(encodeURIComponent(this)); }
    String.prototype.normalise_to_unicode = function(){return decodeURIComponent(escape(this));   }
    
    String.prototype.crypt_symmetric = function(key){
      var me = this + "";                                             //unlink reference
    
      key = Number(String(Number(key))) === key ? Number(key) : 13;   //optionaly provide key for symmetric-like-""encryption"".
    
      me = me.split('')                                               //to array of characters.
             .map(function(c){return c.charCodeAt(0);})               //to array of numbers (each is character's ASCII value)
             .map(function(i){return i ^ key;        })               //XOR ""ENCRYPTION""
             ;
      me = String.fromCharCode.apply(undefined, me);                  //one-liner trick: array-of-numbers to array-of-characters (ASCII value), join to single string. may result in buffer-overflow on long string!
      return me;
    };
    
  • Examples:

    • "hello".crypt_symmetric();
      will result with ehaab.
    • "שָלוֹם".crypt_symmetric();
      will result with פֵבטִא.

    Optionally keep your characters in the ASCII range,
    by .normalise_to_ascii() and bring them back
    to Unicode using .normalise_to_unicode().

    The explanation “why it is required?” is a bit long,
    so it is up to you if it is needed or not.

    Basically, since XOR creates a little character-shift,
    You might end up with a “control-character”, that might make your code looks ugly,
    at this case you can always use "YOUR_STRING".crypt_symmetric().normalise_to_ascii() and btoa,
    to keep it as a BASE64 string,
    followed by atob and "YOUR_STRING".normalise_to_unicode().crypt_symmetric() to restore it :]

  • Yes. The same function acts as an ecryptor and as a decryptor.
    It uses a very simple symmetric-encryption using XOR and a key,
    which by default is 13, but you may, optionally, provide your own key (number).
  • You are provided with some-what longer function,
    to help you visualise the steps, and simplified your understanding.
    Feel free to modify, minify the base structure to make it more/less complex to your needs… :]

    • Best to keep it simple though.

also available on this gist:
https://gist.github.com/eladkarako/738ff6791dd2e44baeb5787851f874d5


A slightly minified version of the same, as above..

String.prototype.norm_to_ascii=function(){return unescape(encodeURIComponent(this))};
String.prototype.norm_to_unicode=function(){return decodeURIComponent(escape(this))};
String.prototype.crypt_sym=function(k){return String.fromCharCode.apply(undefined,this.split("").map(function(c){return c.charCodeAt(0)^(k||13)}))};

//do this manually
btoa("password".norm_to_ascii().crypt_sym());
//get "fWx+fnpif2k="
//store "fWx+fnpif2k=" in your code along with those 3 functions above.
//
//when needed the value, run:
atob("fWx+fnpif2k=").norm_to_unicode().crypt_sym()
//get "password"
//....done....

Continue reading

FFMPEG Logo – Easiest SVG Format!

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <g transform="translate(5,5)">
    <path fill="none" stroke="#008700" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" d="M 0,0 20,0 0,20 0,40 40,0 60,0 0,60 20,60 60,20 60,40 40,60 60,60"/>
  </g>
</svg>

How to include it? – It is quite easy too!

plain
You can include it, simply "as is", just keep in mind to, either
put a little \ before each " or wrap the entire thing with '.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" version="1.1"><g transform="translate(5,5)"><path fill="none" stroke="#008700" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" d="M 0,0 20,0 0,20 0,40 40,0 60,0 0,60 20,60 60,20 60,40 40,60 60,60"/></g></svg>

escape
%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%3E%3Cg%20transform%3D%22translate%285%2C5%29%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23008700%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M%200%2C0%2020%2C0%200%2C20%200%2C40%2040%2C0%2060%2C0%200%2C60%2020%2C60%2060%2C20%2060%2C40%2040%2C60%2060%2C60%22/%3E%3C/g%3E%3C/svg%3E

encodeURI
%3C?xml%20version=%221.0%22%20encoding=%22UTF-8%22%20standalone=%22no%22?%3E%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20version=%221.1%22%3E%3Cg%20transform=%22translate(5,5)%22%3E%3Cpath%20fill=%22none%22%20stroke=%22#008700%22%20stroke-width=%229%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%20d=%22M%200,0%2020,0%200,20%200,40%2040,0%2060,0%200,60%2020,60%2060,20%2060,40%2040,60%2060,60%22/%3E%3C/g%3E%3C/svg%3E

encodeURIComponent
%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%3E%3Cg%20transform%3D%22translate(5%2C5)%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23008700%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M%200%2C0%2020%2C0%200%2C20%200%2C40%2040%2C0%2060%2C0%200%2C60%2020%2C60%2060%2C20%2060%2C40%2040%2C60%2060%2C60%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E


choose either one and paste it into the following instead of {.....IMAGE HERE......} below. <img type="image/svg+xml" src="data:image/svg+xml;charset=UTF-8,{.....IMAGE HERE......}"/>

Avoid Chrome’s ‘no-referrers’ And ‘reduced-referrer-granularity’

Do not use --no-referrers and --reduced-referrer-granularity command-line switches with chrome.exe (neither Google-Chrome nor Chromium).

There is an old bug that will f**k up the rendering AND the network engines,
and that will render some websites useless/ non-reactive.

– Mostly those whom are using ajax-login/dynamic (in DOM) cookie updates.

You CAN (and should) use the chrome://flags/#reduced-referrer-granularity flag instead.

FFMPEG – Video Cut, FAST!

  • Cut the file into the required chunk, without any encoding using -codec "copy".
  • Keep in mind the starting point, provide a “pre-jump” to speed up file processing, using double -ss: first is -ss ABSOLUTE followed by -i FILE, followed by second -ss RELATIVE.

Here is the best practice on how to cut the 00:34:10.161-00:34:11.211 part of the video.

ffmpeg -ss "00:34:00" -i "in.mp4" -codec "copy" -ss "00:00:10.161" -to "00:00:11.211"  "out.mp4"

instead of (don’t use it like that!)

ffmpeg -i "in.mp4" -codec "copy" -ss "00:34:10.161" -to "00:34:11.211"  "out.mp4"

Note that “copy”, does, in-fact makes it fast enough to be still bearable..

you still have to encode the out.mp4,
but it will be much faster than working on the original file!

Continue reading

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.

JavaScript Ninja – Minify JSON, Easily! With Almost No-Code!!!

Given the following JSON:

{
  "@context":           "http://schema.org"
, "@type":              "WebSite"
, "url":                "http://icompile.eladkarako.com/"
, "name":               "Elad Karako Computer Science Corner"
, "alternateName":      "iCompile Is A Tech-Personal Blog Written By Elad Karako ☕︎"
, "logo":               "http://icompile.eladkarako.com/img/apple-touch-icon.png"
, "potentialAction": {  "@type": "SearchAction"
                     ,  "target": "http://icompile.eladkarako.com/?s={search_term_string}"
                     ,  "query-input": "required name=search_term_string"
                     }
}
  1. First, store the raw string somewhere, for example, get it from a textarea (its value),
    say you’ve put it into a variable named CONTENT.
  2. Next, remove all line-feed/break characters for safe/compatibility with the JSON parsing method we’ll use next.
    Simply use: CONTENT = CONTENT.replace(/[\r\n]+/g," "); (replacing things with SPACE is safer than removing them…)
    You’ll end up with one-line:

    '{   "@context":           "http://schema.org" , "@type":              "WebSite" , "url":                "http://icompile.eladkarako.com/" , "name":               "Elad Karako Computer Science Corner" , "alternateName":      "iCompile Is A Tech-Personal Blog Written By Elad Karako ☕︎" , "logo":               "http://icompile.eladkarako.com/img/apple-touch-icon.png" , "potentialAction": {  "@type": "SearchAction"                      ,  "target": "http://icompile.eladkarako.com/?s={search_term_string}"                      ,  "query-input": "required name=search_term_string"                      } }'
    
  3. Use

    CONTENT = JSON.parse('{   "@context":           "http://schema.org" , "@type":              "WebSite" , "url":                "http://icompile.eladkarako.com/" , "name":               "Elad Karako Computer Science Corner" , "alternateName":      "iCompile Is A Tech-Personal Blog Written By Elad Karako ☕︎" , "logo":               "http://icompile.eladkarako.com/img/apple-touch-icon.png" , "potentialAction": {  "@type": "SearchAction"                      ,  "target": "http://icompile.eladkarako.com/?s={search_term_string}"                      ,  "query-input": "required name=search_term_string"                      } }');

    which will convert it to a javascript-object.

  4. And finally use something like CONTENT = JSON.stringify(CONTENT, null, 0);, to get the string.
    You’ll end up with something like:

    '{"@context":"http://schema.org","@type":"WebSite","url":"http://icompile.eladkarako.com/","name":"Elad Karako Computer Science Corner","alternateName":"iCompile Is A Tech-Personal Blog Written By Elad Karako ☕︎","logo":"http://icompile.eladkarako.com/img/apple-touch-icon.png","potentialAction":{"@type":"SearchAction","target":"http://icompile.eladkarako.com/?s={search_term_string}","query-input":"required name=search_term_string"}}'
    
  5. DONE!
    ..Enjoy!!!

APKMirror.com Search

https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=YOUR_SEARCH_TERM

for example:
https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=whatsapp
or
https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=youtube
or
https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=swiftkey


naturally it would have been better if the website owners were embedding
the following script schema:

<script type="application/ld+json">
{
  "@context":           "http://schema.org"
, "@type":              "WebSite"
, "url":                "https://www.apkmirror.com/"
, "name":               "APKMirror - Free APK Downloads"
, "alternateName":      "Download Free Android APKs #APKPLZ"
, "logo":               "https://www.apkmirror.com/wp-content/themes/APKMirror/images/apple-touch-icon-180x180.png"
, "potentialAction": {  "@type": "SearchAction"
                     ,  "target": "https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s={search_term_string}"
                     ,  "query-input": "required name=search_term_string"
                     }
}
</script>

why it is important to a website to have this “thing” in the main index-page?
1. Desktop browsers (Chrome) will add the website with embedded search into the address-bar,
for example, I have (similar) application/ld+json in icompile.eladkarako.com,
which means I could start typing the URL following by SPACE and get a built-in search from within the browser:

2. it will work pretty well with mobile-browsers as well, saving typing and browsing-time to the website-visitor (which is a good thing).

3. it works well with Google search and other spiders, which will build-up a more efficient index/map of the website.

4. it is pretty much “the standard” (or at least a “best practice”) when designing a friendly, browse’able website.


once you’ve visited a website that has the application/ld+json code inside,
it should add it automatically to your website,
but you may also access that section, quite easily for manual editing:


Here are few more links :)
https://developers.google.com/search/docs/data-types/sitelinks-searchbox
https://schema.org/SearchAction
https://github.com/archon810/apkmirror-public/issues/18#issue-231810436

JavaScript Snippet – Google’s Hebrew-Keyboard Component

(function() { google.elements.keyboard.loadme({id:"he",title:"\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea",direction:"rtl",mappings:{"":{"":";1234567890-=/'\u05e7\u05e8\u05d0\u05d8\u05d5\u05df\u05dd\u05e4][\\\u05e9\u05d3\u05d2\u05db\u05e2\u05d9\u05d7\u05dc\u05da\u05e3,\u05d6\u05e1\u05d1\u05d4\u05e0\u05de\u05e6\u05ea\u05e5."},s:{"":'~!@#$%^&*)(_+QWERTYUIOP}{|ASDFGHJKL:"ZXCVBNM<>?'},l:{"":";1234567890-=QWERTYUIOP][\\ASDFGHJKL;'ZXCVBNM,./"},sl:{"":"\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05c2\u05c1\u05b9\u05bc/'\u05e7\u05e8\u05d0\u05d8\u05d5\u05df\u05dd\u05e4][\u05bb\u05e9\u05d3\u05d2\u05db\u05e2\u05d9\u05d7\u05dc\u05da\u05e3,\u05d6\u05e1\u05d1\u05d4\u05e0\u05de\u05e6\u05ea\u05e5."},
"c,sc,cl,scl":{"4m":"\u20aa\u05bf",EU:"\u20ac\u05f0",HJ:"\u05f2\u05f1"}}}); })()
(function () {
  google.elements.keyboard.loadme({
    id: "he"
    , title: "\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea"
    , direction: "rtl"
    , mappings: {
      "": {
        "": ";1234567890-=/'\u05e7\u05e8\u05d0\u05d8\u05d5\u05df\u05dd\u05e4][\\\u05e9\u05d3\u05d2\u05db\u05e2\u05d9\u05d7\u05dc\u05da\u05e3,\u05d6\u05e1\u05d1\u05d4\u05e0\u05de\u05e6\u05ea\u05e5."
      }
      , s: {
        "": '~!@#$%^&*)(_+QWERTYUIOP}{|ASDFGHJKL:"ZXCVBNM<>?'
      }
      , l: {
        "": ";1234567890-=QWERTYUIOP][\\ASDFGHJKL;'ZXCVBNM,./"
      }
      , sl: {
        "": "\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05c2\u05c1\u05b9\u05bc/'\u05e7\u05e8\u05d0\u05d8\u05d5\u05df\u05dd\u05e4][\u05bb\u05e9\u05d3\u05d2\u05db\u05e2\u05d9\u05d7\u05dc\u05da\u05e3,\u05d6\u05e1\u05d1\u05d4\u05e0\u05de\u05e6\u05ea\u05e5."
      }
      , "c,sc,cl,scl": {
        "4m": "\u20aa\u05bf"
        , EU: "\u20ac\u05f0"
        , HJ: "\u05f2\u05f1"
      }
    }
  });
})()
(function () {
  google.elements.keyboard.loadme({
    id: "he"
    , title: "עִבְרִית"
    , direction: "rtl"
    , mappings: {
      "": {
        "": ";1234567890-=/'קראטוןםפ][\\שדגכעיחלךף,זסבהנמצתץ."
      }
      , s: {
        "": '~!@#$%^&*)(_+QWERTYUIOP}{|ASDFGHJKL:"ZXCVBNM<>?'
      }
      , l: {
        "": ";1234567890-=QWERTYUIOP][\\ASDFGHJKL;'ZXCVBNM,./"
      }
      , sl: {
        "": "ְֱֲֳִֵֶַָֹּׁׂ/'קראטוןםפ][ֻשדגכעיחלךף,זסבהנמצתץ."
      }
      , "c,sc,cl,scl": {
        "4m": "₪ֿ"
        , EU: "€װ"
        , HJ: "ײױ"
      }
    }
  });
})()

Minimal Base64 With Unicode Support

btoa(unescape(encodeURIComponent("א")))
===> btoa("א")
===> "15A="

decodeURIComponent(escape(atob("15A=")))
===> decodeURIComponent(escape("א"))
===> "א"

Faster YouTube

Add the following adblock/uBlock origin rules:

Block rules

googleapis.com/youtubei/v1/log_interaction
youtube.com$beacon,important
youtube.com*adunit
youtube.com/*/log_interaction
youtube.com/annotation
youtube.com/api/stats
youtube.com/api/stats/ads
youtube.com/feed_change
youtube.com/feed_change_ajax
youtube.com/pagead
youtube.com/ptracking
youtube.com/share_ajax
ytimg.com/yts/img/favicon
ytimg.com/yts/img/pixel
yts.ag/images/vpn*
doubleclick.net
s.youtube.com
/generate_204
/gen_204
/pixel

And add those hide rules too :

youtube-nocookie.com,youtube.com##.logo.doodle, .ytp-title-channel-logo, [class*="promo"], [class*="related-channel"], [class*="ytp-ad"], [id*="-ads"], [id*="ad_"], [id^="feed-main"] > ol:nth-of-type(1) > li:nth-of-type(1), [id^="header"] > [id^="video-masthead"], [id^="watch-action-panels"]

It will keep all of YouTube’s core functions,
eliminating ads, statistics, beacons and analytic-requests.

Making Your YouTube Super Fast!

Don’t Use Chrome Command-Line Switch `enable-gpu-memory-buffer-compositor-resources` It Will Break Your HTML5 Videos!

For Chrome/Chromium.

When you “talk to the video-renderer”, to specify that all compositor resources should be backed by GPU memory buffers,
You use the “feature flag” --enable-gpu-memory-buffer-compositor-resources,
while good for various developing aspects, it will show you green video screen instead of the video (on YouTube).

Please do not use it for now.

Make Chrome Faster

1. Use Chrome/Chromium Of x64bit, if your machine can handle it.

2. Install those both official Chrome-extensions:
https://chrome.google.com/webstore/detail/dalkfakmooljfejnddeaibdkgbbogpea
https://chrome.google.com/webstore/detail/pcgokfnmpaefeofjpbicabmcadpcnhon

3. Access chrome://flags/ and change the following values,
you may easily reach either of those by copy&&paste them into the address-bar.

👉 chrome://flags/#num-raster-threads ➧4
👉 chrome://flags/#default-tile-width ➧1024
👉 chrome://flags/#default-tile-height ➧1024

👉 chrome://flags/#enable-fast-unload ➧Enable
👉 chrome://flags/#smooth-scrolling ➧Disable
👉 chrome://flags/#enable-quic ➧Enable
👉 chrome://flags/#enable-zero-copy ➧Enable
👉 chrome://flags/#enable-site-per-process ➧Enable
👉 chrome://flags/#v8-cache-options ➧’Cache V8 parser data.’
👉 chrome://flags/#v8-cache-strategies-for-cache-storage
➧’Aggressive’
👉 chrome://flags/#enable-scroll-anchoring ➧Disable
👉 chrome://flags/#enable-pointer-events ➧Enable
👉 chrome://flags/#passive-listener-default ➧’Force All True’
👉 chrome://flags/#document-passive-event-listeners ➧Enable
👉 chrome://flags/#passive-event-listeners-due-to-fling ➧Enable
👉 chrome://flags/#expensive-background-timer-throttling ➧Enable
👉 chrome://flags/#enable-nostate-prefetch ➧’Enabled Prerender’
👉 chrome://flags/#enable-resource-prefetch ➧’Enable Prefetching’
👉 chrome://flags/#delay-navigation ➧Disable

4. Just before the restart required in stage [3] (above),
close all other tabs (other than chrome://flags/),
access chrome://net-internals/#dns in a new-tab, and click the ‘clear host cache’, you can safely close the chrome://net-internals/#dns now, and back in the chrome://flags/ click on the big-blue ‘relaunch now’ button.

5. Run Chrome with the following command-line switches:

--enable-accelerated-vpx-decode="0x03" --prefetch-search-results --disable-pinch --disable-in-process-stack-traces --enable-tcp-fastopen --enable-threaded-compositing --enable-gpu-scheduler --use-double-buffering --enable-hardware-overlays --enable-partial-raster --disable-speech-api --ipc-connection-timeout="90"  --enable-gpu-memory-buffer-compositor-resources --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --disable-payment-request --disable-3d-apis --disable-logging --disable-presentation-api --enable-rgba-4444-textures --v8-cache-options="data" --v8-cache-strategies-for-cache-storage="aggressive"

you may use a .bat or .cmd batch file if it is easier for you,
or use my https://github.com/eladkarako/iniRun project.
here is my ini file (for chromium :])

[Information]
Parent_Folder=C:\Users\Elad\AppData\Local\Chromium\Application

Arguments=--force-device-scale-factor="1.2" --enable-accelerated-vpx-decode="0x03" --allow-outdated-plugins --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\PEPFLA~1.DLL" --ppapi-flash-version="24.0.0.221" --prefetch-search-results --enable-lcd-text --enable-font-antialiasing=1 --ppapi-antialiased-text-enabled=1 --no-referrers --reduced-referrer-granularity --force-ui-direction=ltr --enable-pepper-testing --keep-alive-for-test --disable-pinch --ipc-connection-timeout="90" --disable-hang-monitor --disable-in-process-stack-traces --enable-tcp-fastopen --enable-threaded-compositing --enable-grouped-history --ash-md=enabled --material-design-ink-drop-animation-speed="fast" --show-md-login --top-chrome-md="material" --secondary-ui-md="material" --enable-gpu-scheduler --show-md-login --disable-md-oobe --use-double-buffering --desktop-window-1080p --enable-hardware-overlays --enable-partial-raster --disable-speech-api --enable-gpu-memory-buffer-compositor-resources --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --disable-payment-request --disable-3d-apis --disable-logging --disable-presentation-api --enable-rgba-4444-textures --v8-cache-options="data" --v8-cache-strategies-for-cache-storage="aggressive" --enable-threaded-compositing --no-referrers


;;// Overrides the timeout, in seconds, that a child process waits for a
;;// connection from the browser before killing itself.
;;const char kIPCConnectionTimeout[]          = "ipc-connection-timeout";


Full_Path=C:\Users\Elad\AppData\Local\Chromium\Application\chrome.exe

Run_Mode=SW_SHOWMAXIMIZED

search this blog for newer ways to download all recent command-line switches and this might also help: https://github.com/eladkarako/Chrome-Command-Line-Switches :]

Enjoy!

Google Message :] *Sign* RGBA_4444 Textures Still Does Not Works Perfectly…

Update: Working! You are welcome to try it yourself,
in your Chrome/Chromium browser: --enable-rgba-4444-textures.


If you’re having N7v2 or N10 it will still break..
so by default it is set to disable flag on new Chrome/Chromium versions…

If you so choose to enable it,
You’ll see a ren. message (From N10)

I/chromium( 2104): [INFO:CONSOLE(0)] "[.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'", source: file:///sdcard/clanktemp/index.html (0)

I like the helpful logs,
those whom are addressing you are a thinking person,
and suggest *things* :]

WebSocket Killer – For Real!

Yet another useful Chrome-extension,

it workarounds the limitation of Chrome,
forbidding setting the WebSocket object to undefined by running the code,
from within the web-page, and not by proxy from the extension.
It does so by obfuscating (just a little bit) the code, running it as BASE64.

you can download it, pack it using chrome’s extension page (developers mode),
and drag-and-drop the crx on to the extensions page to install it.

https://github.com/eladkarako/Chrome-Extension-Socket-Killer

For now, only available (premium version and FOR FREE!) through github and not from Google-store :]

JavaScript Ninja – Fake “Native-Code” – For Function’s toString, A.K.A: Obfuscation Magic Helper

The magic is really just using styles to mimic the style used by Chrome’s console output.

console.log(“%cfunction ” + “%ctoString() { [native code] }”, “font-style:italic; color:rgb(180,42,158);”, “font-style:italic;”)

may be required slightly different styling,
and “per browser” styling on different browsers to
mimic the “native code” a.k.a “don’t debug me”, more complete :]

Google Accounts, And The New Non-Standard Placeholder – And How To Remove It!

This might bug you when typing:

Since its transition up/down is not perfect,
and it covers the real, native, input element.

If you’re having uBlock origin, simply add the rule:
google.com##input[type^="password"] + div[jsname][aria-hidden]

Notes:
– perfectly safe.
– due to a parsing bug don’t use [type="password"] but partial-match (*,^ or $).
– you can make it as generic as you’ll like:
google.com##input + [jsname][aria-hidden] to fix it for other input types
google.com##input + [aria-hidden]
or even ##input + [aria-hidden] will do just fine, since aria-hidden are purely informational, so they can be safely be hidden (display:none as is..) or even totally removed!


In-fact, scratch that!.

The elements are still buggy and focus-stealing unless removed from the DOM,
which sadly can not be done with uBlock/AdBlock (those will simply just hide it..)

You better download the Google Chrome-extension:
https://chrome.google.com/webstore/detail/dhgdpjkcnjbcdlhlmlogepplbicplmdm

Block Sockets? Ask Me How!

This Little Chrome Extension: https://github.com/eladkarako/Chrome-Extension-Socket-Killer
Acts As A Socket-Firewall, Blocking WebSocket Connections, Even Before Connecting!
As A Bonus, It Also Null’ifies The WebSocket Object-Constructor :]

Blocking websockets, prevents the next-gen. ads from infiltrating your- presumingly ads-protected, browser.

It will also improve your Ad-Blocking extensions, catching most ads, blocking more connections, etc..

Enjoy.

JavaScript Ninja – NamedNodeMap, But Flat!

Given the following HTML-code, describing some sort of an element (a lazy-load image in that case..)

<img class="w" data-frz-src="/th_B2BB13CEF623A7F1D2F82B8D2014C030FFD3128A_4.jpg" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" onload="lzld(this)" onerror="lzld(this)">

Serialising or looping through its attributes, although feasible, will be quite a pain, handling with NamedNodeMap unnesessary-complicated object structure.


This code:

NamedNodeMap.prototype.map = Array.prototype.map;

var a = document.querySelectorAll('img[src^="data"][src*="base64"]')[0];

a.attributes.map(function(attribute){
  return {name: attribute.nodeName, value:attribute.nodeValue};
});

Will lower-the-lovel of complexity, and will give you an array of name,value objects (much less pain in the ass to serialise, or loop through), but it is not very useful if you are looking for something specific..

[{
    "name": "class"
  , "value": "w"
}, {
    "name": "data-frz-src"
  , "value": "/th_B2BB13CEF623A7F1D2F82B8D2014C030FFD3128A_0.jpg"
}, {
    "name": "src"
  , "value": "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
}, {
    "name": "onload"
  , "value": "lzld(this)"
}, {
    "name": "onerror"
  , "value": "lzld(this)"
}]

This code, will flat the attributes to something more readable,
a plain key,value object, where (matching the HTML logic anyway..) each key
matches to a unique attribute-name – and its value.

NamedNodeMap.prototype.reduce = Array.prototype.reduce;

var a = document.querySelectorAll('img[src^="data"][src*="base64"]')[0];

a.attributes.reduce(function(structure, attribute){
  structure[attribute.nodeName] = attribute.nodeValue;
  return structure;
},{});
{
    "class": "w"
  , "data-frz-src": "/th_B2BB13CEF623A7F1D2F82B8D2014C030FFD3128A_0.jpg"
  , "src": "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
  , "onload": "lzld(this)"
  , "onerror": "lzld(this)"
}

An ultimate way of just allowing to get at any given time the key/value object (above),
is by adding a prototype method, into NodeHTMLElement:

HTMLElement.prototype.getAttributes = function(){
  var me = this;
  return Array.prototype.map.call(me.attributes, function(attribute){
    return {name: attribute.nodeName, value:attribute.nodeValue};
  });
})

So you could just do a ...querySelector(...).getAttributes(),
to get just the array of the keys, simply go with Object.keys( ...querySelector(...).getAttributes() ).

Feature-Policy Header

Very early draft, but newest Chrome/Chromium will show warnings,
if you do not allow the use of those features.

Also, you probably need to activate handling this new, draft feature in your Chrome’s flags-section: chrome://flags/#enable-feature-policy, otherwise Chrome will probably ignore any directives..
Either from HTTP-headers or iframe attributes… and will apply the simple can/can’t logic (for example, vibration enabled only when inside a user-click handle method, etc..) .

Here is an Apache snippet to add a few useful features:

#feature policy
<ifModule mod_headers.c>
  Header set Feature-Policy '{"vibrate":["*"],"geolocation":["*"],"fullscreen":["*"]}'
</ifModule>

read more: https://github.com/WICG/feature-policy

For iframes you should either use the same format of JSON-like,
or a simpler one that uses enable attribute, still not 100% set.

you may specify both for now, and best to allow them with sandbox too (more secure):

<iframe src="https://..." sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation" seamless="false" featurepolicy='{"vibrate":["*"],"geolocation":["*"],"fullscreen":["*"]}' enable="vibrate geolocation fullscreen"></iframe>

Continue reading

JavaScript Ninja – Crowd Wisdom eBay Enhancements

Making eBay Buying Safer, Using Wisdom Of The Crowd.

Protect Yourself Against:
– Untrustworthy sellers
Those will accept your money but will not send you anything.
– Bad-reputation sellers
without checking out their feedbacks.
– New and inexperienced sellers
without researching their profile.

– Only trust sellers with “a lot of buyers”.
– Avoid items with overpriced shipping.
– Sort by “number of sold items” – in additional to current sorted results.
Continue reading

Adding ‘Noto Mono’, ‘Courier New’, ‘Droid Sans Mono’, ‘Roboto Mono’, ‘Ubuntu Mono’ To Windows’ CMD

Just make sure you have those (you can google-search them or look for them at fonts.google.com, the ‘Courier New’ font-face should be already installed in your Windows).

feel free to edit/replace/add more,
make sure the fonts are mono-type, use ‘000…00’ as name.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont]
"000"="Noto Mono"
"0000"="Courier New"
"00000"="Droid Sans Mono"
"000000"="Roboto Mono"
"0000000"="Ubuntu Mono"

If you don’t know of name of the font (it should be exactly right!),
open any program that does some sort of font selection, and allows copy&paste, such as Microsoft-Word or even Notepad2/Notepad++.

Notepad2 has a “default font” selection, which I’m not going to actually change, but just use it to browse-for font-names.

the standard control-panel, used by most (simple) does also allow easy copy&paste.

Hebrew Nikud, Using Unicode!

Easy copy&&paste of Hebrew letters with Nikud (extended), including the Hebrew letters
which can be useful for lack of Hebrew keyboard.

here is the real page you can play with…
Continue reading

Hebrew Unicode-Range

U+05BE,U+05C0,U+05C3,U+05C6,U+0591-U+05C7,U+05D0-U+05EA,U+05F0-U+05F4,U+FB1D-U+FB36,U+FB38-U+FB3C,U+FB3E,U+FB40-U+FB41,U+FB43-U+FB44,U+FB46-U+FB4F
U+05B0-U+05B9,U+05BB-U+05BC,U+05C1-U+05C2

Updated to latest Unicode (v9.0)
https://en.wikipedia.org/wiki/Unicode_and_HTML_for_the_Hebrew_alphabet
https://en.wikipedia.org/wiki/Hebrew_(Unicode_block)

The Unicode-range of each-letter

U+0591: HEBREW ACCENT ETNAHTA
U+0592: HEBREW ACCENT SEGOL
U+0593: HEBREW ACCENT SHALSHELET
U+0594: HEBREW ACCENT ZAQEF QATAN
U+0595: HEBREW ACCENT ZAQEF GADOL
U+0596: HEBREW ACCENT TIPEHA
U+0597: HEBREW ACCENT REVIA
U+0598: HEBREW ACCENT ZARQA
U+0599: HEBREW ACCENT PASHTA
U+059A: HEBREW ACCENT YETIV
U+059B: HEBREW ACCENT TEVIR
U+059C: HEBREW ACCENT GERESH
U+059D: HEBREW ACCENT GERESH MUQDAM
U+059E: HEBREW ACCENT GERSHAYIM
U+059F: HEBREW ACCENT QARNEY PARA

U+05A0: HEBREW ACCENT TELISHA GEDOLA
U+05A1: HEBREW ACCENT PAZER
U+05A2: HEBREW ACCENT ATNAH HAFUKH
U+05A3: HEBREW ACCENT MUNAH
U+05A4: HEBREW ACCENT MAHAPAKH
U+05A5: HEBREW ACCENT MERKHA
U+05A6: HEBREW ACCENT MERKHA KEFULA
U+05A7: HEBREW ACCENT DARGA
U+05A8: HEBREW ACCENT QADMA
U+05A9: HEBREW ACCENT TELISHA QETANA
U+05AA: HEBREW ACCENT YERAH BEN YOMO
U+05AB: HEBREW ACCENT OLE
U+05AC: HEBREW ACCENT ILUY
U+05AD: HEBREW ACCENT DEHI
U+05AE: HEBREW ACCENT ZINOR
U+05AF: HEBREW MARK MASORA CIRCLE

U+05B0: HEBREW POINT SHEVA
U+05B1: HEBREW POINT HATAF SEGOL
U+05B2: HEBREW POINT HATAF PATAH
U+05B3: HEBREW POINT HATAF QAMATS
U+05B4: HEBREW POINT HIRIQ
U+05B5: HEBREW POINT TSERE
U+05B6: HEBREW POINT SEGOL
U+05B7: HEBREW POINT PATAH
U+05B8: HEBREW POINT QAMATS
U+05B9: HEBREW POINT HOLAM
U+05BA: HEBREW POINT HOLAM HASER FOR VAV
U+05BB: HEBREW POINT QUBUTS
U+05BC: HEBREW POINT DAGESH OR MAPIQ
U+05BD: HEBREW POINT METEG
U+05BE: HEBREW PUNCTUATION MAQAF
U+05BF: HEBREW POINT RAFE

U+05C0: HEBREW PUNCTUATION PASEQ
U+05C1: HEBREW POINT SHIN DOT
U+05C2: HEBREW POINT SIN DOT
U+05C3: HEBREW PUNCTUATION SOF PASUQ
U+05C4: HEBREW MARK UPPER DOT
U+05C5: HEBREW MARK LOWER DOT
U+05C6: HEBREW PUNCTUATION NUN HAFUKHA
U+05C7: HEBREW POINT QAMATS QATAN

U+05D0: HEBREW LETTER ALEF
U+05D1: HEBREW LETTER BET
U+05D2: HEBREW LETTER GIMEL
U+05D3: HEBREW LETTER DALET
U+05D4: HEBREW LETTER HE
U+05D5: HEBREW LETTER VAV
U+05D6: HEBREW LETTER ZAYIN
U+05D7: HEBREW LETTER HET
U+05D8: HEBREW LETTER TET
U+05D9: HEBREW LETTER YOD
U+05DA: HEBREW LETTER FINAL KAF
U+05DB: HEBREW LETTER KAF
U+05DC: HEBREW LETTER LAMED
U+05DD: HEBREW LETTER FINAL MEM
U+05DE: HEBREW LETTER MEM
U+05DF: HEBREW LETTER FINAL NUN

U+05E0: HEBREW LETTER NUN
U+05E1: HEBREW LETTER SAMEKH
U+05E2: HEBREW LETTER AYIN
U+05E3: HEBREW LETTER FINAL PE
U+05E4: HEBREW LETTER PE
U+05E5: HEBREW LETTER FINAL TSADI
U+05E6: HEBREW LETTER TSADI
U+05E7: HEBREW LETTER QOF
U+05E8: HEBREW LETTER RESH
U+05E9: HEBREW LETTER SHIN
U+05EA: HEBREW LETTER TAV

U+05F0: HEBREW LIGATURE YIDDISH DOUBLE VAV
U+05F1: HEBREW LIGATURE YIDDISH VAV YOD
U+05F2: HEBREW LIGATURE YIDDISH DOUBLE YOD
U+05F3: HEBREW PUNCTUATION GERESH
U+05F4: HEBREW PUNCTUATION GERSHAYIM

A bidirectional font-faces that are Hebrew-capable:

Alef, 'SBL BibLit', 'SBL Hebrew', 'David CLM', 'Frenk Ruehl CLM', 'Hadasim CLM', Cardo, Shofar, David, 'Ezra SIL', 'Ezra SIL SR', 'Noto Sans Hebrew', FreeSerif, 'Times New Roman', FreeSans, Arial;

You can use the following snippet to load-up a font-face with spefic “by letter support” (Noto Sans, in-this case..)

/* hebrew */
@font-face {
  font-family: 'Noto Sans Hebrew';
  font-style: normal;
  font-weight: 400;
  src: local('Noto Sans Hebrew'), local('NotoSansHebrew'), url(https://fonts.gstatic.com/s/notosanshebrew/v5/QZOobcJ7ccckcnN4idgy78ymZCRHoYBsRD5MU0Qw5G8.woff2) format('woff2');
  unicode-range: U+0590-05FF, U+20AA, U+25CC, U+FB1D-FB4F;
}

*note that you might want to edit the range to match the above range, this is “as is from Google..”.

and later simply add the Noto-Sans-Hebrew in-front of the definition to every-element, it will handle exclusively just the Hebrew content, will fallback to Noto-Sans for the other latin characters whom it won’t have built-in-glyph-support.

for example:

*{ font-family: 'Noto Sans Hebrew', 'Noto Sans', sans-serif; }

Stuff You Should Exclude From Your Anti-Virus

It should be perfectly safe to exclude some folders from your anti-virus processing.
Have a look below, my notes/comments should help you understand the generic state-of mind and then you can apply the same reasoning to modify or add other items.

Continue reading

NodeJS Snippet – File Access/Modification Stat And Utimes One-Second Scope

You might get a high-precision (milliseconds) from the file-stat,
but you have to use a lower-resolution value, for utimes.

It is got to do with internal-linking to the operation-system’s libs..

but here is a nice working example for you to play-with,
essentially just reading a file’s content and last-modification/last-access times,
and rewrite the file (delete/write new one) with some altered-content,
but restoring the timestamp of the original file.

for this example to work just place a text file named file.txt, with any content, and any timestamp (you can set timestamp manually using variety of programs..), and see that the file with the new content is keeping its timestamp after-all.

/* Working With NodeJS' `utimes` and `stat`.*/
var fs      = require('fs')
   ,path    = require('path')
   ,file    = path.resolve('./file.txt')     //will work on every OS (even though it is a "Unix-slash").
   ,stat    = fs.lstatSync(file)             //preform any action on symbolic-link itself. (for example unlink, to delete a symbolic-link without following it to delete the actual file)
 //,stat    = fs.statSync(file)              //follow symbolic-link to where it points, file might be placed in another folder!
   ,content
   ;

content = fs.readFileSync(file, {encoding: "utf8"});
content = content.replace(/foo/g, "bar") + "\nSome Junk...";

fs.unlinkSync(file);
fs.writeFileSync(file, content, {encoding: "utf8"});

fs.utimesSync(file, stat.atime.getTime()/1000, stat.mtime.getTime()/1000); //will restore the access/modification time of the original-file.

/*
.atime                access time
.mtime                modification time
.birthtime || .ctime  creation time     */

You can read about this issue on:
https://github.com/nodejs/node/issues/2069#issuecomment-294596104.

CSS Snippet – The Magical Rotated Logo

Wish to place a logo that will be rotated 360-degrees back-and-forth gently on mouse-hover?

Here is your example.
right click it and select view frame’s-source to see the code behind it.

Using transition to transform the logo to rotate 360 degrees, is lovely,
but it is a one way animation-
– If you wish to keep on the movement as long the mouse-is-hovered upon the logo,
using keyframe-animation is the way to go.

right click it and select view frame’s-source to see the code behind it.

This would probably render an even higher-quality result,
since keyframe-animation uses, unambiguously, the GPU to render frames smoothly,
You can prefer the use of keyframe-animation in-favor of transition, or at-least use it in the same way, by specifying that the animation should repeat only one time.

Weirdly the ease-in-out effect, when a user no-longer hover the logo, and the animation is then rendered backward, back to the zero-position, seems to only work when using simple transition :/

Nevermind.. :]

PHP Snippet – Close Connection With A Non-Standard HTTP-Status

Send header Connection: close using <?php header('Connection: close');?> is simple enough.
When using a non-standard HTTP-status, make sure to put its definition (through header) first.

Here is the correct way of doing it:

<?php
header('HTTP/1.1 418 I\'m a teapot', true);
header("Connection: close");
?>

You’ll want to specify the HTTP-status, in-full,
in the example above I’m using the 418 I'm a teapot,
RFC2324 – Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) which, is a joke HTTP-status.

And although it is very much a real HTTP-status, you can not normally just put it at the end of header('Connection: closed', true, 418), since it will apparently won’t be parsed correctly and simply return an error 500..

So to make sure it is 100% supported, always send the HTTP-status using header, unambiguously.

Some older Apache server will probably try to gzip-compress your response,
this can be also quickly avoided by flushing the output-buffer and specifying a zero-length content:

<?php
while(ob_get_level()>0){@ob_end_flush();}
header('HTTP/1.1 418 I\'m a teapot', true);
header("Content-Encoding: none");
header("Content-Length: 0");
header("Connection: close");
?>

Actually when I’m thinking about it,
maybe you better even use HTTP 1.0 in the response,
since keep-alive is pretty much a given fact in HTTP 1.1 (unless declared otherwise).

So this might be a better way utilising it:

<?php
while(ob_get_level()>0){@ob_end_flush();}
header('HTTP/1.0 418 I\'m a teapot', true);
header("Content-Encoding: none");
header("Content-Length: 0");
header("Connection: close");
?>

Ps.
If you wish to set the HTTP version dynamically, without messing with it, just replace the correct line in the code above with this one:
header(filter_input(INPUT_SERVER, "SERVER_PROTOCOL", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . ' 418 I\'m a teapot');.

HTML5 – Remove 300ms Delay On-Touch/Click – No JavaScript Required!

  1. Include a viewport tag in the <HEAD> with specific width definition.
    You may specify a minimal-one: <meta name="viewport" content="width=device-width"/>
    or a bit more complex one with initial-scale: <meta name="viewport" content="height=device-height,width=device-width,initial-scale=1.0,minimum-scale=1.0,minimal-ui"/> (you may forbid zooming/re-scale by also adding ,user-scalable=no which will slightly improve overall performances and rendering speed).
  2. Second *thing* is to instruct the page to disable double-tap gesture, it is an official technique, recommended by Mozilla/Google.

    /*`manipulation`
     * Enable panning and pinch zoom gestures, 
     * but disable additional non-standard gestures
     * such as double-tap to zoom. Disabling double-tap 
     * to zoom removes the need for browsers to delay 
     * the generation of click events
     * when the user taps the screen. This is an alias 
     * for "pan-x pan-y pinch-zoom"
     * (which, for compatibility, is itself still valid).
     */
    html{
      touch-action: pan-x pan-y pinch-zoom;
      touch-action: manipulation;
    }
    

    The above rule will be compatible with all the browsers you can think of (yes IE too), and will not require setting any onclick/ontouchstart/ontouchend/etc.. hooking events, neither halt event-bubbling.

    As always with those html-set-rules, you better put the rule-block pretty early in-your CSS-file, you you may have an option to override the touch-action rule with a different value to a specific node, a good place is probably right-after the ‘css-clear/zero code’ at the start of the file.

Java And UTF-8

java -Dfile.encoding=UTF-8

working with Windows’ console/batch file? make sure to also change the code-page using chcp:

chcp 65001
.....\java.exe -Dfile.encoding=UTF-8 .......

Continue reading

ExifTool – Ultimate Batch To Remove All Tags, From Infinite List Of Files, With Verbose Status And Progress Report

ExifTool is a free and open-source software program for reading, writing, and manipulating image, audio, video, and PDF metadata. It is platform independent, available as both a Perl library (Image::ExifTool) and command-line application. ExifTool is commonly incorporated into different types of digital workflows and supports many types of metadata including Exif, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the manufacturer-specific metadata formats of many digital cameras.

http://www.sno.phy.queensu.ca/~phil/exiftool/
https://en.wikipedia.org/wiki/ExifTool
https://sourceforge.net/projects/exiftool/
https://downloads.sourceforge.net/project/exiftool/exiftool-10.48.zip?r=&ts=1491744058&use_mirror=netix

The following example is a batch for Windows operation-system, but it can be easily migrated to any other supported OS, to use it, just mark a bunch of files (any amount! it does not limited to usual batch-queue-limit of 9) and drag&drop them over the batch-file.

Plus it will work on any file, naturally file-types that are not supported by the ExifTool will be ignored (skipped), so feel free to just use [CTRL]+[A] to select all the files without pin-point-select just the ones you need.. or unsure if they will be supported, if it will, it will.. and if it won’t, it won’t.. :]

remove_metadata.cmd:

@echo off
:LOOP
::has argument ?
if ["%~1"]==[""] (
  echo done.
  goto END;
)
::argument exist ?
if not exist %~s1 (
  echo not exist
  goto NEXT;
)
::file exist ?
echo exist
if exist %~s1\NUL (
  echo is a directory
  goto NEXT;
)
::OK
echo is a file

set FILE_INPUT="%~s1"
set FILE_OUTPUT="%~d1%~p1%~n1_fixed%~x1"

call exiftool -progress -verbose -ignoreMinorErrors -XMPToolkit="" -all="" -trailer:all="" "%FILE_INPUT%"


:NEXT
shift
goto LOOP

:END
pause

Nice Scrollbars

Those bulky scrollbars with the useless ‘arrows’
are mostly the cause of large-font in compare to a low(er) screen-resolution.

The up/down arrows are mostly useless now-days anyway,
since it requires pin-point accuracy with the mouse,
which in most cases is not essential-
– and it is far more fun to just drag away the middle-thingy anyhow..

If you’re a page designer, HTML5 developer,
consider this minimal set of CSS3 rules to make your end result look far better:
The scrollbar will have constant dimensions, and will allow more efficient scrolling.

Continue reading