Skip to content

Instantly share code, notes, and snippets.

View jqntn's full-sized avatar
☣️

Julien QUENTIN jqntn

☣️
View GitHub Profile
@jqntn
jqntn / xxdi.ps1
Created May 5, 2025 22:10
Fast xxd -i implementation in Windows PowerShell
$file_name = ($args[0] -replace '\W', '_').ToLower()
$file_bytes = [System.IO.File]::ReadAllBytes($args[0])
$hex_array = New-Object string[] $file_bytes.Length
for ($i = 0; $i -lt $file_bytes.Length; $i++) {
$hex_array[$i] = '0x{0:x2}' -f $file_bytes[$i]
}
$hex_string = [string]::Join(', ', $hex_array)
"unsigned char $file_name[] = { $hex_string };"
"unsigned int ${file_name}_len = $($file_bytes.Length);"
@jqntn
jqntn / get-android-tools.bat
Last active October 29, 2024 00:11
Minimal batch script to install OpenJDK, Android NDK, and Android SDK
@echo off
net session 1>NUL 2>NUL || goto :not_admin
cd C:\
echo INFO: Installing latest OpenJDK 21 LTS from Microsoft at C:\open-jdk...
curl -LO https://aka.ms/download-jdk/microsoft-jdk-21.0.5-windows-x64.zip
tar -xf microsoft-jdk-21.0.5-windows-x64.zip
del -f microsoft-jdk-21.0.5-windows-x64.zip