Skip to content

Instantly share code, notes, and snippets.

View Beaglefoot's full-sized avatar

Stanislav Chernov Beaglefoot

  • Moscow, Zelenograd
View GitHub Profile
@Beaglefoot
Beaglefoot / concurrentGen.ts
Created November 13, 2021 20:22
Executes array of promise-returning functions with provided concurrency level
type Task<R> = () => Promise<R>
/** Execute array of promise-returning functions with provided concurrency level */
async function* concurrentGen<R>(tasks: Task<R>[], concurrency: number) {
async function withIndex(task: Task<R>, index: number) {
const result = await task()
return { result, index }
}
const queues = tasks.splice(0, concurrency).map(withIndex)
from contextlib import contextmanager
import os
import sys
from pprint import pprint
def get_python_version(venv_path: str) -> str:
version = ""
with open(os.path.join(venv_path, "pyvenv.cfg")) as cfg:
@Beaglefoot
Beaglefoot / avg_cpu_load.sh
Created August 4, 2022 15:24
avg_cpu_load
#!/bin/bash
cat /proc/stat | awk ' $1 == "cpu" { idle_time = $5; for (i = 2; i <= 10; i++) total_time += $i } END { print 100 - 100 * (idle_time / total_time) } '
@Beaglefoot
Beaglefoot / questions.md
Last active August 12, 2024 11:24
DE вопросы к интервью

Intro

  • Можешь ли выделить 1 или 2 скилла, без которых современному дата инженеру вообще никак? Почему?
  • Как построить озеро данных, чтобы оно не превратилось в болото?
  • Какую самую долгую задачу ты решал?
    • Как планировал?
    • Как удерживал мотивацию?
    • Как преодолевал трудности?

Python

  • ABC