Skip to content

Instantly share code, notes, and snippets.

View malash's full-sized avatar
:octocat:
Open-source

Malash malash

:octocat:
Open-source
View GitHub Profile
@malash
malash / homebrew.patch
Created August 27, 2023 17:26
`/opt/homebrew`'s patch to fix compatible with `proxychains-ng` on macOS Ventuna
diff --git a/bin/brew b/bin/brew
index 6e4416259..c8ddcc6e2 100755
--- a/bin/brew
+++ b/bin/brew
@@ -198,12 +198,13 @@ then
fi
# filter the user environment
-PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
@malash
malash / bench.js
Last active December 24, 2023 20:18
NodeJS Buffer vs DataView performance benchmark
const os = require("os");
const benchmark = require("nodemark");
const str = "a".repeat(1 << 10);
const buffer = Buffer.from(str);
const dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);
console.log("NodeJS version:", process.version);
console.log("CPU name:", os.cpus()[0].model);