Skip to content

Instantly share code, notes, and snippets.

View aslafy-z's full-sized avatar

Zadkiel AHARONIAN aslafy-z

View GitHub Profile
@aslafy-z
aslafy-z / _sort_-V_without_-V.sh
Last active March 20, 2025 17:23
`sort -V` with sort versions that have no `-V`. Source https://stackoverflow.com/a/23993452/4266494.
sed -Ee 's/^([0-9.]+)$/\1.-1/' | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 | rev | cut -d. -f2- | rev
@aslafy-z
aslafy-z / -svg-auto-square-fit-download-bookmarklet.md
Last active March 13, 2025 10:20
SVG Auto-Square-Fit & Download Bookmarklet

SVG Auto-Square-Fit & Download Bookmarklet

This convenient bookmarklet automatically adjusts an SVG file loaded directly in the browser to be centered in a square viewBox, adds a configurable margin around the content, and initiates a quick download of the modified SVG.

🚀 Usage

  • Open a standalone SVG file directly in your browser.
  • Click the bookmarklet.
  • When prompted, enter your desired margin in pixels.
  • The modified SVG will be downloaded automatically, named after your original file.
@aslafy-z
aslafy-z / helm-compare.sh
Last active March 27, 2025 12:24
Script that compares two Helm charts from various sources (local, tarball, Git, OCI)
#!/bin/sh
set -e
# Function to display usage information
usage() {
echo "Helm Chart Comparison Tool"
echo
echo "This script compares two Helm charts from various sources (local, tarball, Git, OCI)."
echo
@aslafy-z
aslafy-z / opencv-python-with-gstreamer-on-windows.md
Last active January 29, 2025 10:01
Build opencv-python with Gstreamer support on Windows
function loadResource(type, sources) {
let index = 0;
function tryLoad() {
if (index >= sources.length) {
console.error(`${type.toUpperCase()} load failed.`);
return;
}
let el = type === 'js' ? document.createElement('script') : document.createElement('link');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aslafy-z
aslafy-z / scrollbar.css
Created January 7, 2025 14:38
Mini CSS Scrollbar
/* Apply custom scrollbar styles */
#content-list::-webkit-scrollbar {
width: 6px; /* Width of the scrollbar */
}
#content-list::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.3); /* Color of the scrollbar thumb */
border-radius: 3px; /* Round edges for the scrollbar */
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.