This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { | |
| Worker | |
| } = require('worker_threads'); | |
| // const NUM_WORKERS = os.cpus().length; | |
| const NUM_WORKERS = 12; | |
| const START = 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "flake empty env"; | |
| inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs | |
| outputs = | |
| { self, ... }@inputs: | |
| let | |
| supportedSystems = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "flake empty env"; | |
| inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs | |
| outputs = | |
| { self, ... }@inputs: | |
| let | |
| supportedSystems = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| browsercontrol: | |
| build: . | |
| environment: | |
| - TZ=Europe/Istanbul | |
| - CHROME_CLI=--remote-debugging-port=9222 | |
| - MCP_CDP_ENDPOINT=http://127.0.0.1:9222 | |
| # - MCP_CDP_ENDPOINT=http://host.docker.internal:9222 # local browser access | |
| ports: | |
| - "127.0.0.1:3000:3000" # HTTP Chromium desktop gui |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM lscr.io/linuxserver/chromium:latest | |
| USER root | |
| COPY ./conf/autostart /defaults/autostart | |
| RUN chmod +x /defaults/autostart | |
| # install node 22 (current LTS) | |
| RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - \ | |
| && apt-get update && apt-get install -y nodejs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PromiseQue { | |
| constructor(concurrentCount = 5) { | |
| this.todo = []; | |
| this.running = []; | |
| this.maxTask = concurrentCount; | |
| } | |
| runNext(){ | |
| return ((this.running.length < this.maxTask) && this.todo.length); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from airflow.providers.cncf.kubernetes.operators.pod import KubernetesPodOperator | |
| from airflow.utils.dates import days_ago | |
| from airflow.models import Variable | |
| from airflow.decorators import dag, task | |
| default_args = { | |
| "owner": "me", | |
| "start_date": days_ago(1), | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY: up down shell | |
| down: | |
| docker compose down --rmi local --volumes --remove-orphans | |
| up: | |
| docker compose up $(filter-out $@,$(MAKECMDGOALS)) | |
| shell: | |
| docker compose exec app bash |
NewerOlder