Skip to content

Instantly share code, notes, and snippets.

View Almenon's full-sized avatar

Almenon Almenon

View GitHub Profile
import { spawn } from "child_process"
// 8192*2 (16384 aka 16KB) is the highWaterMark (aka buffer size?)
const node_process = spawn("node", ["-e", "process.stdout.write('a'.repeat(8192*2+1));setTimeout(()=>{console.log('done')},4000)"])
node_process.on('error', err => console.error(err))
let numFlushes = 0
node_process.stdout.on('data', (buffer: Buffer) => {
numFlushes += 1
@Almenon
Almenon / node_buffer_issue_python_script.py
Created May 19, 2020 04:58
node_buffer_issue_python_script
import sys
from time import sleep
# numBytes = 2 ** 29
# sys.stdout.write("a" * numBytes)
# only one flush
# sys.stdout.write("a")
# sys.stdout.flush()
# sleep(0.000000000000001)
{ "key": "ctrl+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "ctrl+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "ctrl+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "ctrl+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "ctrl+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "ctrl+6", "command": "workbench.action.openEditorAtIndex6" },
{ "key": "ctrl+7", "command": "workbench.action.openEditorAtIndex7" },
{ "key": "ctrl+8", "command": "workbench.action.openEditorAtIndex8" },
{ "key": "ctrl+9", "command": "workbench.action.openEditorAtIndex9" },
{ "key": "alt+8", "command": "workbench.action.focusEighthEditorGroup" },
@Almenon
Almenon / terraform.md
Last active January 13, 2023 22:14
Learn terraform in y minutes

Adapted from adambard/learnxinyminutes-docs#3949

Introduction

HCL (Hashicorp Configuration Language) is a high-level configuration language used in tools from Hashicorp (such as Terraform). HCL/Terraform is widely used in provisioning cloud infastructure and configuring platforms/services through APIs. This document focuses on a most recent HCL syntax (0.13).

HCL is a declarative language and terraform will consume all *.tf in the current folder, so code placement order and sequence has no significance. Sub-folders can be consumed through modules.

@Almenon
Almenon / test
Created April 13, 2024 17:23
test
26473722532523467899555