Skip to content

Instantly share code, notes, and snippets.

Simplify Your Typescript Streams with AsyncIterable<T>: A Beginner's Guide to Stream Processing

Streams, AsyncIterable, TypeScript... sounds complex, doesn't it? But fear not! In this article, we're taking a leisurely stroll through the world of stream processing with a handy tool called strict-stream that helps to manage iterators.

Just simple explanations and examples. Let's dive in!

What's All This Stream Talk?

Streams are like digital rivers flowing with data. Imagine a conveyor belt carrying items past you, one at a time.

@slavahatnuke
slavahatnuke / gist:493a7d2aa50046a78a082cdfb9044ecf
Last active June 23, 2021 17:01 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have a few days to learn the

  • Very basics of modelling
  • Domain-Driven Design
  • CQRS and Event Sourcing

Here's what you should do

In the evenings read the Domain-Driven Design Quickly Minibook

@slavahatnuke
slavahatnuke / .bashrc
Last active May 10, 2022 22:09
Bash completion / Bash autocomplete setup
## ------------------
## bash
PS1="@\W$ "
## k8s minikube
if command -v minikube &>/dev/null
then
const LRU = require("lru-cache");
async function test1() {
console.log('TEST1')
const cache = new LRU({
max: 1,
dispose: function (key, n) {
console.log('close', key, n)
},
id first_name last_name email gender ip_address first_name
1 Dennie Abrahamowitcz dabrahamowitcz0@unesco.org Female 19.229.240.93 DupCol_Dennie
2 Fleur Denes fdenes1@stanford.edu Female 163.123.150.155 DupCol_Fleur
3 Reggy Gillcrist rgillcrist2@ustream.tv Male 6.204.140.162 DupCol_Reggy
4 Aldus Caldicot acaldicot3@nba.com Male 50.188.12.85
5 Alex Blackwood ablackwood4@amazon.de Male 140.68.57.219
6 Yank Wooler ywooler5@google.fr Male 176.170.114.39
7 Gracia Seale gseale6@wikispaces.com Female 157.128.139.125
8 Eb Richel erichel7@dyndns.org Male 196.70.225.73
9 Rowland Elland relland8@fema.gov Male 79.242.102.153
id first_name first_name_added last_name email gender ip_address
1 Dennie A Abrahamowitcz dabrahamowitcz0@unesco.org Female 19.229.240.93
2 Fleur B Denes fdenes1@stanford.edu Female 163.123.150.155
3 Reggy C Gillcrist rgillcrist2@ustream.tv Male 6.204.140.162
4 Aldus Caldicot acaldicot3@nba.com Male 50.188.12.85
5 Alex Blackwood ablackwood4@amazon.de Male 140.68.57.219
6 Yank Wooler ywooler5@google.fr Male 176.170.114.39
7 Gracia Seale gseale6@wikispaces.com Female 157.128.139.125
8 Eb Richel erichel7@dyndns.org Male 196.70.225.73
9 Rowland Elland relland8@fema.gov Male 79.242.102.153
docker system prune -f && docker rmi $(docker images -aq) -f || echo IMAGESOK && docker volume prune -f && echo DOCKERCLEANUP
@slavahatnuke
slavahatnuke / deployment.yml
Created May 28, 2020 20:22
deployment.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
spec:
replicas: 2
template:
metadata:
labels:
sudo snap install microk8s --classic
echo "PATH=$PATH:/snap/bin" >> .bashrc
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
id first_name last_name email gender ip_address
1 Dennie Abrahamowitcz dabrahamowitcz0@unesco.org Female 19.229.240.93
2 Fleur Denes fdenes1@stanford.edu Female 163.123.150.155
3 Reggy Gillcrist rgillcrist2@ustream.tv Male 6.204.140.162
4 Aldus Caldicot acaldicot3@nba.com Male 50.188.12.85
5 Alex Blackwood ablackwood4@amazon.de Male 140.68.57.219
6 Yank Wooler ywooler5@google.fr Male 176.170.114.39
7 Gracia Seale gseale6@wikispaces.com Female 157.128.139.125
8 Eb Richel erichel7@dyndns.org Male 196.70.225.73
9 Rowland Elland relland8@fema.gov Male 79.242.102.153