Enlarge CCleaner’s Font-Size

This is a walk-through, that will help you to change (- enlarge) the default font-size of the (wonderful) CCleaner program,
so it will look nice on large-screens, although this can be done globally by setting the operation-system’s DPI settings to something like 120%,
the following explanation is better, if you’ll will to modify, just, CCleaner – and not your entire system :)

This is kind of a lite reverse-engineering. Don’t be scared – YOU CAN DO IT! + EASILY!

I’ve modified the default font-size (8pt) to a much larger/clear 14pt. You may choose a different value.

The original:
icompile.eladkarako.com_enlarge_ccleaner_font_size3

The modified:
icompile.eladkarako.com_enlarge_ccleaner_font_size4

The modified, using Hebrew as default language, it works well- without any additional modifications (affects all languages).
icompile.eladkarako.com_enlarge_ccleaner_font_size5

Continue reading

CCleaner INI Rip

CCleaner has internal resources, such as EXE, INI, string tables for languages, PNG and Bitmaps,
Here is the INI section, which might help you understand what is behind each cleanup section,
the format is the same format as the custom INI you can add or the ccleaner.ini that stores the settings for you (on portable version it sits under the same folder as ccleaner.exe)
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,

Continue reading

PHP Snippet – EMAIL Validation

  • Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains
    http://squiloople.com/2009/12/20/email-address-validation/.

    (boolean)preg_match(
      '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)'      .
      '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)'                  .
      '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)'         .
      '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*'       .
      '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)'  .
      '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}'   .
      '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:'    .
      '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}'    .
      '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD'
      ,
      $address
    );
    
  • An older regex that doesn’t need a recent PCRE

    (boolean)preg_match(
      '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>'                     .
      '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")'            .
      '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*'  .
      '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})'                .
      '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:'               .
      '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?'          .
      '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:'                   .
      '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?'             .
      '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}'             .
      '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD'
      ,
      $address
    );
    
  • This is the pattern used in the HTML5 spec for validation of ’email’ type form input elements.
    http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)

    (boolean)preg_match(
      '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
      '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD'
      ,
      $address
    );
    
  • No PCRE! Do something _very_ approximate!
    Check the address is 3 chars or longer and contains an @ that’s not the first or last char.

    strlen($address)       >=   3                       &&
    strpos($address, '@')  >=   1                       &&
    strpos($address, '@')  !==  (strlen($address) - 1)
    
  • And, good old email validation (which gets updated every PHP version, so it is not “so bad”)

    (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
    

JavaScript Ninja – Edit Everything, Safely

(function (query, style) {
  "use strict";

  query = top.prompt("Enter Query.", "*");
  query = "string" !== typeof query || "" === query ? "*" : query;

  document.querySelectorAll(query).forEach(function(element){
    element.setAttribute("contenteditable", "true");
  });
  
  style = document.createElement("style");
  style.appendChild(document.createTextNode([ " /*<![CDATA[*/"
                                            , " ###REPLACE_ME###, ###REPLACE_ME###:before, ###REPLACE_ME###:after{"
                                            , "   pointer-events: none !important;"
                                            , "   touch-action:   none !important;"
                                            , "}"
                                            , "/*]]>*/"
                                            ].join("\n").replace(/###REPLACE_ME###/g,query)));
  document.querySelector("body").appendChild(style);

  return undefined;
}());

Making stuff contentEditable="true" is easy enough, but you’ll find that hyperlinks (<a> elements) are still clickable,
– lucky CSS3 has some features you can add to make elements somewhat unresponsive to a click. Events hooks might still be effective though..

icompile-eladkarako-com_edit_everything_part_2_no_clicking-png

CSS3 – Let Your Users Know They Can Use [CTRL]+[A] To Select The Code In PRE and CODE elements

PRE, CODE and essentially every element having the contentEditable=”true” attribute is made 100% well.. editable,
which is very useful if you want to have “textarea like” qualities such as pressing [CTRL]+[A] to select all of the code in those elements (mostly for copy&paste).

But, since this is not the default behaviour, there is a need to inform your users of the UI quality, usually in this case you can use the title attribute (but it requires setting text for each element), in this case a CSS only solution, either TEXT or an IMAGE will work wonderfully with our requirements.

icompile-eladkarako-com_inform_your_users_of_ctrl_a_option_in_contenteditable_true_containers-png
Continue reading

CSS3 Organization Specific Prefixes

prefix	organization
-ms-, mso-	Microsoft
-moz-	Mozilla
-o-, -xv-	Opera Software
-atsc-	Advanced Television Standards Committee
-wap-	The WAP Forum
-khtml-	KDE
-webkit-	Apple
prince-	YesLogic
-ah-	Antenna House
-hp-	Hewlett Packard
-ro-	Real Objects
-rim-	Research In Motion
-tc-	TallComponents

FFMPEG Use In Product Review For Time-Lapse

I’ve bought 3 clocks from eBay seller (good4deal999) that offered a “Travel Quartz” quality clocks,

When two of the 3 started showing wrong hour I’ve decided to record them all together for as long as my phone’s camera will allow (two hours with the lowest pixel settings)

They are all the SAME initial state (the one on the left is just at an angle to the camera)

In-fact the one on the right even got the first battery, so it should, be ahead in few seconds but it is delayed for -5 minutes every ~hour.
The one in the middle is just F*CKED up entirely. the one on the left, as the ONLY one actually working :..(

– – – – – –
Took it with my Samsung phone on tripod.
Original file: 20160912_003810.mp4
Recorded video was two hours and 18 minutes (2:18:23) and about 3 Gigabytes (3.22GB)
Resolution is VGA 640x480, which is quite low but in close-up.
In order to rotate it (filmed on the side), fix it (double frames due to Samsung’s camera bug), remove background sound of me (kind’a) snoring (it was just before bed), make it ready for web-streaming better and speed it up x5 times more fast (which saves me uploading 3Giga, plus it helps identify the problem better
I’ve used the following FFMPEG command line:

ffmpeg -y -hide_banner -i 20160912_003810.mp4 -an -vf "transpose=2,mpdecimate,setpts=N/FRAME_
RATE/TB,setpts=0.2*PTS" -preset veryslow -tune zerolatency -pix_fmt yuv420p -movflags "+faststart" -crf 23 "output.mp4"

Full FFMPEG Output:
Continue reading

HTML5-SVG Ninja – Textual Half A Star

SVG is so easy on drawing vector-graphic,
BUT it handles text in images very well (you can copy/paste it as well).

Use Unicode symbol 🌟︎ and fill it halfway with yellow color to create a nice very easy to use SVG-image :)

You can right click it to view the source or open it in a new tab.

Continue reading

JavaScript Snippet – Object Sort

This is straightforward (but memory-efficient) Object (“JSON”-like) recursive sort.
It can handle both Arrays And Objects.

function sort_object(obj){ /* json like */
  var result = {};

  Object.keys(obj).sort().forEach(function(key){
    key = String(key);
    result[key] = obj[key];
  });

  return result;
}

function is_object(a){
  return "object" === typeof a &&
         "object" === a.constructor.name.toLowerCase()
}

function is_array(a){
  return "object" === typeof a &&  
         "array"  === a.constructor.name.toLowerCase()
}

function sorter(a){
  /* nothing to sort (2 cases) */
  if(null  === a)                return a;
  if(false === is_object(a) && 
     false === is_array(a))      return a;

  a = true === is_object(a) ? sort_object(a) :
      true === is_array(a)  ? a.sort()       :
      a /* will not arrive here.. */
      ;

  Object.keys(a).forEach(function(aa){
    a[aa] = sorter(a[aa]);
  });

  return a;
}

Continue reading

WhatsAPP’s Status API

Over HTTPS, and with no requiring of log-in, auth or any token, you are free to ping it if you’ll ever require a fast response (lighttpd[wiki]) from a valid HTTPS (SSL) server, that will have almost 100% up-time. Which is kind’a useful :)

  • For

    You will get text/xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <status>
    <function name="registration" available="true" since="1311836400" />
    <function name="chat" available="true" since="1314015300" />
    </status>
    
  • For https://www.whatsapp.com/status.php?v=2

    You will get application/json:

    {"email":{"available":true},"last":{"available":true},"sync":{"available":true},"chat":{"available":true},"group":{"available":true},"multimedia":{"available":true},"online":{"available":true},"profile":{"available":true},"push":{"available":true},"registration":{"available":true},"status":{"available":true},"broadcast":{"available":true},"version":{"available":true}}
    

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

Continue reading