Skip to content

Instantly share code, notes, and snippets.

@Jonarod
Jonarod / Makefile
Created March 31, 2023 17:41 — forked from francois-rozet/Makefile
Step-by-step Makefile tutorial
# Macros
ALL = program1 program2 program3
SRCDIR = src/
BINDIR = bin/
EXT = cpp
CXX = g++
CXXFLAGS = -std=c++14 -O3 -Wall -Wextra
@Jonarod
Jonarod / readlines.js
Created March 21, 2023 17:59 — forked from bwasti/readlines.js
Fast line reading in bun
async function readlines(stream, callback, buffer_len = 16) {
const reader = stream.getReader()
const td = new TextDecoder('ascii')
let overflow = null
let buffer = []
function flush_buffer() {
for (let b of buffer) {
callback(td.decode(b))
}