Skip to content

Instantly share code, notes, and snippets.

View Elschnagoo's full-sized avatar
🦉
NightOwl

Elschnagoo Elschnagoo

🦉
NightOwl
View GitHub Profile
@Elschnagoo
Elschnagoo / Semaphor.ts
Created July 28, 2022 02:37
Simple Typescript Semaphor / Mutex
import crypto from 'crypto';
export type SemElement = [string, (value: any | PromiseLike<any>) => void];
export class Semaphor {
private curQueue: Map<string, SemElement>;
private readonly max: number;
private callbackQueue: SemElement[];
@Elschnagoo
Elschnagoo / Main.kt
Last active October 18, 2021 21:58
SemperVideo
import java.io.File
import java.time.Duration
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
fun readFileAsLinesUsingBufferedReader(fileName: String): List<String>
= File(fileName).bufferedReader().readLines()
fun main(args: Array<String>) {
val path="" //PATH