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 / Calculating Levenshtein-Distance and real-world use in finding similar words from a given array of potentially similar words.js
Created Dec 8, 2019
[no-dependencies][plain-js] Calculating Levenshtein-Distance and real-world use in finding similar words from a given array of potentially similar words.js
View Calculating Levenshtein-Distance and real-world use in finding similar words from a given array of potentially similar words.js
/**
* @param {string} b
* @return {number}
*/
String.prototype.levenshtein_distance = function(b){ "use strict";
var a = this || ""
,distanceMatrix
;
distanceMatrix = Array(b.length + 1) // Create empty edit distance matrix for all possible modifications of substrings of a to substrings of b.
@eladkarako
eladkarako / javascript_fisher_yates_shuffle_algorithm_simplified_example.js
Created Dec 4, 2019
javascript_fisher_yates_shuffle_algorithm_simplified_example.js
View javascript_fisher_yates_shuffle_algorithm_simplified_example.js
//this shuffle prevents the case of moving same cell multiple times.
//each cell is moved onces due to source-array getting smaller and smaller.
var a = ['a','b','c','d','e'];
var b = [];
a = a.reverse(); //results feels more random.
View public suffix list.txt
xn--9krt00a
xn--fjq720a
xn--ngbe9e0a
xn--mgba7c0bbn0a
xn--80ao21a
xn--80aqecdr1a
xn--xkc2al3hye2a
xn--9dbq2a
xn--1qqw23a
xn--8y0a063a
@eladkarako
eladkarako / imagemagic_image_resize_keep_proportion_multiple_dragndrop_support.cmd
Created Nov 16, 2019
ImageMagic / ImageMagik resize image. Either the width or the height will take the size, but proportion will be kept, can handle multiple drag/drop targets. the original images will be renamed to a same name and extension but with an additional extension suffix of '.bak' .
View imagemagic_image_resize_keep_proportion_multiple_dragndrop_support.cmd
::@echo off
::-----------------------------------------------------
:: support multiple files drag&drop over this batch. -
:: will resize to 800width and proportion height. -
::-----------------------------------------------------
chcp 65001 2>nul >nul
pushd "D:\Software\ImageMagic"
::one size serves all image resizing.
set /p "SIZE=Enter Size: [800x800] "
@eladkarako
eladkarako / ModuleInitialize.bas
Last active Nov 14, 2019
Visual Basic 6.0 - ModuleInitialize.bas
View ModuleInitialize.bas
Option Explicit
'Satisfying API For CoInitializeEx and CoUninitialize of ole32.dll
'Explained and MSDN referenced.
' Elad Karako
Private Enum COINIT_HRESULT
S_OK = &H0& 'The COM library was initialized successfully on this thread.
S_FALSE = &H1& 'The COM library is already initialized on this thread.
RPC_E_CHANGED_MODE = &H80010106 'A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred.
E_INVALIDARG = &H80070057 'One or more arguments are invalid.
@eladkarako
eladkarako / process of decompiling recompiling apk with APKTool and 7zip-zstd, zipalign, keytool and jarsigner.txt
Last active Dec 4, 2019
process of decompiling recompiling apk with APKTool and 7zip-zstd, zipalign, keytool and jarsigner.txt
View process of decompiling recompiling apk with APKTool and 7zip-zstd, zipalign, keytool and jarsigner.txt
1. extract without source:
call "bin\apktool.cmd" --no-src d "myapp.apk"
2. modify Android.manifest - add:
android:debuggable="false" android:versionCode="90" android:versionName="3.3"
to
<application
get the versioncode and versionname information from 'apktool.yml',
the information is near the bottom of the file.
@eladkarako
eladkarako / literalJS.js
Created Nov 8, 2019
literalJS is a way to present text with CSS - by breaking characters allows easing/smooth motion to the entire text-block.
View literalJS.js
document.body.style.cssText="background:lightgray;color:darkgreen;padding:10px;margin:10px;";
document.body.innerHTML='<style>' +
't[x]{font-size:80pt}' +
't[x]:before{content:attr(x); position:relative; transition:all 1.000s ease-out}' +
't[x]:hover:before{color:red; top:-10px; transform:rotate(-720deg); }' +
'</style>' +
'<div solo_true>literalJS by EladKarako</div>' +
'<div solo_false>literalJS by EladKarako</div>'
;
@eladkarako
eladkarako / userscript to for adultswim RobotChicken website to create a video download button.user.js
Created Nov 8, 2019
userscript to for adultswim RobotChicken website to create a video download button
View userscript to for adultswim RobotChicken website to create a video download button.user.js
// ==UserScript==
// @name RobotChickenDownloadButton
// @namespace http://-
// @homepage http://-
// @description Add video download button to adultswim - robot-chicken website.
// @include http://www.adultswim.com/videos/*
// @version d01.m11.y2014
// @run-at document-start
// ==/UserScript==
//window.addEventListener("load",function(){var a=document.evaluate('//input[@type="password"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);if(a.snapshotLength)for(var b,c=0;c<a.snapshotLength;c++){b=a.snapshotItem(c);b.addEventListener("mouseover",function(){this.type="text"},false);b.addEventListener("mouseout",function(){this.type="password"},false)}}(),false);
@eladkarako
eladkarako / comma-first - string json array object beautify.js
Created Nov 8, 2019
comma-first - string json array object beautify.js
View comma-first - string json array object beautify.js
sources = JSON.stringify(sources, null, 2)
.replace(/,[\r\n] /g, "\r\n ,")
JSON.stringify(sources, null, 2)
.replace(/,[\r\n] /g, "\n ,")
.replace(/ *(,( +))/g,"$2,")
JSON.stringify(text, null, 2)
.replace(/,[\r\n] /g, "\r\n ,")
@eladkarako
eladkarako / YouTube emoji in categories.html
Created Nov 8, 2019
YouTube emoji in categories.html
View YouTube emoji in categories.html
<div id="categories-wrapper" class="style-scope yt-emoji-picker-renderer">
<div id="categories" class="style-scope yt-emoji-picker-renderer">
<yt-emoji-picker-category-renderer aria-live="polite" role="listbox" tabindex="0" class="style-scope yt-emoji-picker-renderer" aria-activedescendant="😀" aria-label="People">
<yt-formatted-string id="title" class="style-scope yt-emoji-picker-category-renderer">People</yt-formatted-string>
<div id="emoji" class="style-scope yt-emoji-picker-category-renderer">
<img height="24" role="option" width="24" class="style-scope yt-emoji-picker-category-renderer" id="😀" aria-label=":grinning:" alt="😀" src="https://www.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f600.svg" aria-selected="false">
<img height="24" role="option" width="24" class="style-scope yt-emoji-picker-category-renderer" id="😁" aria-label=":grin:" alt="😁" src="https://www.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f601.svg" aria-selected="false">
<img height="24" role="option" width="24" class="style-scope yt-emoj
You can’t perform that action at this time.