Skip to content

Instantly share code, notes, and snippets.

@eladkarako
eladkarako / sleep.js
Created May 14, 2026 21:17
sleep - promise wrap around setTimeout, can be cancelled
/* sleep
* promise wrap around setTimeout.
* - can be cancelled (stops the timer and rejects the promise immediately).
* - can be set to execute method, with arguments, within a scope.
*
* ---------------------------------------------------------- simple case.
* (async ()=>{
* foo();
* await sleep(50 * 1000); //halts the code-block for 50 seconds.
* bar();
@eladkarako
eladkarako / adding nuget sources to allow you to download nuget packages in visual studio or jetbrains rider (.net, dotnet).md
Created May 10, 2026 18:39
adding nuget sources to allow you to download nuget packages in visual studio or jetbrains rider (.net, dotnet)

you need to run a dotnet.exe command.

if you work in visual studio or jetbrains rider,
you should look for the powershell (or terminal icon),
which automatically has the dotnet in its PATH, allowing you to run it seamlessly.

in any other case you'll need to locate the binary of dotnet.exe
there are few options:

  • C:\Program Files\dotnet\dotnet.exe (prefered when using visual studio)
  • C:\Program Files (x86)\dotnet\dotnet.exe
@eladkarako
eladkarako / cross compile toolkit for linux (wsl too).md
Last active May 3, 2026 19:01
cross compile toolkit for linux (wsl too). `sudo chmod u+x` both, execute by `source ./set_export.sh` to make them effect current shell. you can start with `unset_export.sh` first
  1. sudo apt update

  2. sudo apt install --yes curl

  3. cd ~

  4. curl --insecure --anyauth --ssl-no-revoke --location-trusted --remote-time --url "https://gist.github.com/eladkarako/83ad9b59ec601c831c430866f3dc11b7/raw/afa9da76793c768841aaebd99c2ca601f29263e5/unset_export.sh" --output "unset_export.sh"

  5. curl --insecure --anyauth --ssl-no-revoke --location-trusted --remote-time --url "https://gist.github.com/eladkarako/83ad9b59ec601c831c430866f3dc11b7/raw/afa9da76793c768841aaebd99c2ca601f29263e5/set_export.sh" --output "set_export.sh"

@eladkarako
eladkarako / javascript base64 pretty fast using pre calculated reverse lookup for decoding.js
Last active April 28, 2026 18:50
javascript base64 pretty fast using pre calculated reverse lookup for decoding. string input string output. modern aproach no escape/unescape/encodeURIComponent/decodeURIComponent.
"use strict";
//note: wrap it however you like ;) no dependencies.
//javascript base64 pretty fast using pre calculated reverse lookup for decoding. string input string output. modern aproach no escape/unescape/encodeURIComponent/decodeURIComponent.
//https://gist.github.com/eladkarako/b8f34c063157112a646cffb4b3c635ab#file-javascript-base64-pretty-fast-using-pre-calculated-reverse-lookup-for-decoding-js
/* reverse-lookup table to speed up decoding.
* avoid indexOf/charAt (string search and returning strings), repeated string concatenation, and join.
* Standard Base64: A–Z → 0–25, a–z → 26–51, 0–9 → 52–61, '+' (43) → 62, '/' (47) → 63.
@eladkarako
eladkarako / convert png to icon that is compatible with windows, auto size (you can add more).cmd
Created April 26, 2026 20:07
convert png to icon that is compatible with windows, auto size (you can add more)
@echo off
chcp 65001 1>nul 2>nul
pushd "%~dp0"
set "PATH=%CD%;%PATH%"
"magick.exe" "%~1" -filter Lanczos -define "icon:auto-resize=256,128,64,48,32,16" -unsharp "0x1+0.75+0.02" "%~sdp1%~n1_converted.ico"
pause
popd
exit /b 0
::https://imagemagick.org/download/#windows&gsc.tab=0
@eladkarako
eladkarako / wsl with file explorer gui in windows 11.txt
Created April 24, 2026 15:48
wsl with file explorer gui in windows 11
native to linux:
sudo apt update && sudo apt install -y gnome-terminal nautilus
nautilus .
------------------------------------------------------------------------
native to windows (explorer)
use "specia" network folder:
\\wsl$
\\wsl.localhost
@eladkarako
eladkarako / readme.md
Last active April 24, 2026 19:18
essentials - 7zip with additional codecs, curl
  • right click, save as '7za.exe'
    https://gist.github.com/user-attachments/assets/f4591de8-ffd3-4339-a00e-4e6c85fc024e
  • right click, save as 'curl.exe'
@eladkarako
eladkarako / FreeRAM XP.md
Created April 21, 2026 07:36
FreeRAM XP - modified to be able to run on Windows 11. This is a Borland C++ 1999, from YourWare Solutions ~2005, was never meant to understand anything +4GB of RAM... DOWNLOAD THE PNG AND RENAME TO ZIP.
  1. right click this thing, save as 'FreeRAM XP Pro.zip'
  2. put this in a `.reg` file and double click it to add the information to the registry.
    Windows Registry Editor Version 5.00
    
    ;cleanup
    [-HKEY_CURRENT_USER\Software\YourWare Solutions]
@eladkarako
eladkarako / winkey.ahk
Created April 20, 2026 18:13
winkey was an old program. this autohotkey provides shortcuts to override some of windows (virtual desktop), and add some, sleep improves opening is important., back in the happy days of Windows 95+ that allowed quickly launching programs using the windows key combinations. replaced by autohotkey and cool dll capabilities. sleep before action in…
#Requires AutoHotkey v2.0
#SingleInstance force ; skip prompt and replace old instance automatically.
ListLines false ; disable key history / script lines listing for efficiency.
SetWorkingDir A_ScriptDir ; set working folder to be the script's folder.
;---------------------------------------------------------------------
; WIN+1 - my computer
; WIN+3 - C:\
; WIN+SHIFT+3 - karakocom c
; WIN+5 - D:\
@eladkarako
eladkarako / msi_extractor.cmd
Last active April 12, 2026 14:16
msi_extractor.cmd - extracting msi package, into a folder of its files and the installation script, the result is 100% installable and since it is unpacked it is super fast too, you can view all the files, and you can repack them with 7zip or something. includes MSI exit codes, and log. eladkarako 202604121627.
@echo off
:: you can also add a nice context-menu entry for right-clicking .msi files.
::---------------------------------------------------------------------------
::Windows Registry Editor Version 5.00
::
::[HKEY_CLASSES_ROOT\Msi.Package\shell\msi_extractor]
::"Icon"="%SystemRoot%\\System32\\msiexec.exe,0"
::@="MSI Extractor"
::
::[HKEY_CLASSES_ROOT\Msi.Package\shell\msi_extractor\command]