Skip to content

Instantly share code, notes, and snippets.

View izelnakri's full-sized avatar
🇺🇦
Ember.js is the best.

Izel Nakri | izelnakri.eth izelnakri

🇺🇦
Ember.js is the best.
View GitHub Profile

1. |> Pipeline Operator -> Absolutely needed for superior APIs/implementations in certain cases, otherwise quite limited

I've built an advanced universal test runner and although it is advanced, I can't STILL use the pipeline operator after MANY YEARS!! Adding it would be a massive hack and degrade the performance of my binary and availability of the tools to me SIGNIFICANTLY. Thank you TC39 people and highly cynical reviewers for blocking this amazingly useful and important feature FOR YEARS!

Can I use it now?

not natively, anywhere, and not in this project even with a library. I tested every tool in your pipeline rather than going from memory:

┌────────────┬──────────┬───────────────────────────────────┐
@izelnakri
izelnakri / amazing-tasked-server.ts
Last active July 28, 2026 00:33
One file `task`-ed & `result`-ed coding style. In other words, how to eliminate `try/catch` and `new Promise` from your coding in JS/TS, in a stable & performant way, while showing everything in a single file!
// design.ts — design study: a Task-based web server where the try/catch KEYWORD exists in
// exactly ONE function body in the entire program (Result.try). Endpoints stay flat.
// run: node design.ts (starts on an ephemeral port, demos every endpoint, exits)
// node design.ts --serve (keeps serving; GITHUB_TOKEN honored if set)
// check: deno check design.ts
//
// Routes:
// GET / index
// GET /fs/{path} file-system exposure (file content / directory listing), traversal-safe
// GET /github/:username GitHub public profile → unified Profile JSON
@izelnakri
izelnakri / README.md
Created July 23, 2026 13:30
Prototype for denoland/deno#36272 — deno repl that loads a module with its exports ($) and top-level locals() live and inspectable

repl — a Deno REPL that loads a module with its exports and locals live

Prototype / proof-of-concept for denoland/deno#36272: open any module in deno repl and inspect both its exports ($) and its top-level locals (locals()) — for local paths, file:, https:, jsr:, and npm: (ESM) refs.

$ repl ./scratch.ts        # a file with top-level `const one = …, two = …`
> locals()                 # { one, two, …imports } — every top-level binding, live values
> Object.keys(locals())    # just the names
@izelnakri
izelnakri / gist:5a7f25ab01940f915b01754585ddeac1
Created April 13, 2026 08:40
Major Node.js BUG: process management/children resources
ME: Seems like in node.js process/child management is complex and broken api design/intuition-wise, am I correct with this assessment? Seems like we do all these hacks just to patch
what node.js should have done properly under the hood?
● Partially correct, but the blame is split between Node.js and the OS. Let me be precise about each layer:
Where the complexity is genuinely Node.js's fault:
- detached: true is poorly named and documented. It actually means "create a new process group" — a Unix kernel concept — but the name implies "run independently". Most
developers have no idea it controls the PGID.
- proc.kill() only kills the process you spawned, not its children. Node could have set prctl(PR_SET_PDEATHSIG, SIGKILL) on every spawned child by default (Linux), which would
@izelnakri
izelnakri / flake.nix
Last active August 19, 2025 15:24
NixOS/nixpkgs Testing Conventions. The most advanced tutorial on the internet!
{
description = "Example advanced flake.nix for an advanced/general-purpose software package";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
@izelnakri
izelnakri / flake.nix
Created August 11, 2025 05:30
Advanced multi node test/dev infrastructure on nix
{
description = "Advanced flake.nix for nix based development environment";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
# Initial Scene setup:
# Main
# - WorldEnvironment
# - Node3d (which has this script attached)
# -- XROrigin3D
# --- OpenXRFbSceneManager (has Default Scene of static-body-3d.gd with Scene Setup: `setup_scene`)
# --- XRCamera3D
# --- XRController3D (Left)
# --- XRController3D (Right)
@izelnakri
izelnakri / flake.nix
Created July 4, 2025 09:41
OneAPI whisper.cpp ongoing in-development build process
# OneAPI whisper.cpp ongoing in-development build process
# devShell works(with FHS), `$ nix run .` doesn't work yet, needs OneAPI on nixpkgs/derivation.
{
description = "Development environment for whisper.cpp with Intel compilers and SYCL";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
@izelnakri
izelnakri / bitbox-bridge.nix
Last active March 10, 2025 09:32
flake.nix - Most universal template for any software project
# Example of a binary packaging(storing a frozen binary with deps WITH compiler build) in nix:
# $ nix run --impure --expr 'let pkgs = import <nixpkgs> {}; in pkgs.callPackage ./bitbox-bridge.nix {}'
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
libudev-zero,
}:
@izelnakri
izelnakri / pcall.js
Last active February 26, 2025 01:56
Pcall.js Lua pcall in JavaScript
async function exampleFunc(greeter?: string, another): Promise<string> {
if (!greeter) {
throw new Error('Somethinggg', another);
}
return `Hello, ${greeter} ${another}`;
}
let pcall = (func: Promise<Any> | Function, ...otherArguments: any) => {
if (func instanceof Promise) {