Skip to content

Instantly share code, notes, and snippets.

@cemdrk
cemdrk / flake.nix
Created November 20, 2025 14:53
Flake empty template
{
description = "flake empty env";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
{
description = "flake empty env";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
const maxNum = num => +[...`${num}`].sort((a, b) => b - a).join('');
const minNum = num => +[...`${num}`].sort((a, b) => a - b).join('');
const reachedNums = new Set([]);
const seen = {};
const findKaprekar = (i, _min, _max, prev, step) => {
let diff = _max-_min;
const { Worker, isMainThread, parentPort, workerData } = require('worker_threads');
const os = require('os');
if (isMainThread) {
// Main thread
const NUM_WORKERS = os.cpus().length;
const START = 100;
const END = 100_000_000;
const CHUNK_SIZE = Math.ceil((END - START) / NUM_WORKERS);
const {
Worker
} = require('worker_threads');
// const NUM_WORKERS = os.cpus().length;
const NUM_WORKERS = 12;
const START = 100;