Skip to content

Instantly share code, notes, and snippets.

💭
☕︎

Elad Karako eladkarako

💭
☕︎
Block or report user

Report or block eladkarako

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eladkarako
eladkarako / JavaScript_Human-Readable_TimeDiff.js
Created Jan 12, 2020
JavaScript Human-Readable TimeDiff
View JavaScript_Human-Readable_TimeDiff.js
/* from: http://icompile.eladkarako.com/javascript-human-readable-time-diff/ */
function human_time_diff(from, to){ /*accept unix-datetime integer, Date object or date string, fallback is current date*/
"use strict";
var now, diff;
/*---*/
function difference(diff){
var
MINUTE_IN_SECONDS = 60
@eladkarako
eladkarako / mx_player_apk_modification_to_keep_your_privacy.md
Last active Jan 10, 2020
Modifying MX-Player APK to keep your privacy (no calls to "tracking-server-prod-1.zenmxapps.com", "i.mxplayer.j2inter.com", no version check) - requires Java and APKTool and knowledge of decompiling, recompiling, aligning and signing.
View mx_player_apk_modification_to_keep_your_privacy.md

The following procedure will help to prevent requests to tracking-server-prod-1.zenmxapps.com, evt.mxplay.com, i.mxplayer.j2inter.com and Google-FireBase (application configuration server). It will not remove Google-Analytics requests. It will not remove ads, for that you need to buy the pro version from Google-Play.

You'll need to download the application APK or backup your installation from the Google-Play store, which you can do with various backup-applications. You need Java8 and the reverse-engineering tool APKTool (JAR file).

first decode the APK with java.exe -jar apktool.jar --force --output "project_mxplayer" decode "yourmxplayer.apk"

it will decode assets, resources and smali into a folder named project_mxplayer.

@eladkarako
eladkarako / git_cleanup_update.cmd
Created Jan 8, 2020
git_cleanup_update.cmd will forcefully clean all of the files (-fdx) and pull updates. Include submodules. It accepts a single arguments (folder path).
View git_cleanup_update.cmd
@echo off
::--------------------------------------------::
:: This batch hard-cleans and update a ::
:: git-repository folder (submodules first). ::
:: Compatible with all git versions. ::
::--------------------------------------------::
:: Download git for Windows from: ::
:: github.com/git-for-windows/git/releases/ ::
:: choose the latest x32 + portable release. ::
:: extract and read README.portable . ::
@eladkarako
eladkarako / mxplayer__res__values-iw__strings.xml___fixed_app_name_to_eng.xml
Created Jan 2, 2020
Modifying MX-Player's language-resource using APKTool, to avoid "localized-name", which is annoying.
View mxplayer__res__values-iw__strings.xml___fixed_app_name_to_eng.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="abandon_custom_codec">אין אפשרות לטעון קודק מותאם אישית. במקום זאת, השתמש בקודק ברירת המחדל.</string>
<string name="abc_action_bar_home_description">נווט לדף הבית</string>
<string name="abc_action_bar_up_description">נווט למעלה</string>
<string name="abc_action_menu_overflow_description">עוד אפשרויות</string>
<string name="abc_action_mode_done">סיום</string>
<string name="abc_activity_chooser_view_see_all">ראה הכל</string>
<string name="abc_activitychooserview_choose_application">בחר אפליקציה</string>
<string name="abc_capital_off">כבוי</string>
@eladkarako
eladkarako / splitmix64.js
Last active Jan 1, 2020
http://prng.di.unimi.it/splitmix64.c seamlessly translated into a workable JavaScript code using JavaScript BigInt. [https://icompile.eladkarako.com/splitmix64-js]
View splitmix64.js
/* Written in 2015 by Sebastiano Vigna (vigna@acm.org)
seamlessly translated to JavaScript using BigInt by Elad Karako https://icompile.eladkarako.com/splitmix64-js (January 2020).
To the extent possible under law, the author has dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
See <http://creativecommons.org/publicdomain/zero/1.0/>.
@eladkarako
eladkarako / nodejs_normalize_path_to_unix_style_which_works_in_windows_too.js
Last active Dec 18, 2019
nodejs normalize path to unix style which works in windows too
View nodejs_normalize_path_to_unix_style_which_works_in_windows_too.js
const PATH = require("path")
,RESOLVE = function(path){path=path.replace(/\"/g,"").replace(/\\+/g,"/"); //make unix-style, problem solver for following resolve-command.
path=PATH.resolve(path);
path=path.replace(/[\\\/]+/g,"/").replace(/\/+$/g,""); //normalize multiple slash-characters, normalize to: "string will never have ending slash".
return path;
} //normalize to Unix-slash (will work on Windows too).
;
@eladkarako
eladkarako / APKTool_res_folder_every_language_but_default_deleter.cmd
Last active Dec 27, 2019
APKTool_res_folder_every_language_but_default_deleter.cmd
View APKTool_res_folder_every_language_but_default_deleter.cmd
::@echo off
if ["%~1"] EQU [""] ( goto ERROR_NOARG )
if not exist %~s1\NUL ( goto ERROR_NOTFOLDER )
pushd "%~s1\res"
:: NOTE:
:: KEEP "/values/" folder (default - English). You can delete 'values-en*' folders as-well.
@eladkarako
eladkarako / a-not-so-shitty-google-analytics-javascript-code.php
Created Dec 16, 2019
a-not-so-shitty-google-analytics-javascript-code
View a-not-so-shitty-google-analytics-javascript-code.php
<?php
session_start();
if(! isset($_SESSION['uniqueID'])){ $_SESSION['uniqueID'] = uniqid(); }
setlocale(LC_ALL, 'he_IL.UTF-8');
mb_internal_encoding('UTF-8');
//setlocale(LC_CTYPE, 'en_US.UTF-8');
//header('Content-Type: text/plain;charset=UTF-8');
//header('Content-Type: text/plain;charset=windows-1255');
?><!DOCTYPE html>
@eladkarako
eladkarako / a-not-so-htty-google-analytics-javascript-code-take-2.js
Created Dec 16, 2019
a-not-so-htty-google-analytics-javascript-code-take-2
View a-not-so-htty-google-analytics-javascript-code-take-2.js
//https://icompile.eladkarako.com/a-not-so-htty-google-analytics-javascript-code-take-2/
(function (body, script) {
script.setAttribute("src", "https://www.google-analytics.com/analytics.js");
script.setAttribute("defer", "");
script.onload = function () {
if ("undefined" === typeof window.ga) return;
window.ga("create", "UA-27302073-1", "eladkarako.com");
window.ga("require", "linkid", "linkid.js");
window.ga("require", "displayfeatures");
window.ga("set", "&uid", "<?php print($_SESSION['uniqueID']); ?>");
@eladkarako
eladkarako / prevent-mouse-movement-from-waking-up-the-computer-registry-values.reg
Created Dec 16, 2019
prevent-mouse-movement-from-waking-up-the-computer-registry-values
View prevent-mouse-movement-from-waking-up-the-computer-registry-values.reg
Windows Registry Editor Version 5.00
;; https://icompile.eladkarako.com/prevent-mouse-movement-from-waking-up-the-computer/
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_046D&PID_C534&MI_01&Col01\8&27588a98&0&0000\Device Parameters]
"WaitWakeEnabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\HID\VID_046D&PID_C534&MI_01&Col01\8&27588a98&0&0000\Device Parameters]
"WaitWakeEnabled"=dword:00000000
You can’t perform that action at this time.