Advertisement · 728 × 90

Posts by andrei

Post image

one problem people face when using nginx as load balancer is how to pass real client IP address to the backend servers

nginx supports ip transparency but network setup is complex

simpler way: use proxy_protocol between load balancer nginx and backend nginx!

6 months ago 0 0 0 0

Dan is out here making the arguments for RSC I never knew I needed to hear.

10 months ago 5 1 0 0
Preview
Smashing the state machine: the true potential of web race conditions For too long, web race condition attacks have focused on a tiny handful of scenarios. Their true potential has been masked thanks to tricky workflows, missing tooling, and simple network jitter hiding

A nice write up on the race conditions attacks. While with a single data store, you can tackle those with transactions, but multiple data stores are much harder to secure. portswigger.net/research/sma...

1 year ago 0 0 0 0
How to do distributed locking — Martin Kleppmann’s blog

Good points on distributed locking: martin.kleppmann.com/2016/02/08/h...

1 year ago 0 0 0 0

Turns out you can do grps mirroring with #nginx: inge.4pr.es/grpc-traffic...

I wonder if same trick can be used for websocket mirroring.

1 year ago 1 1 1 0
Exploring V8's strings: implementation and optimizations | iliazeus Exploring V8's strings: implementation and optimizations. Beating c++ with js in a totally 100% legit way. iliazeus

#javascript strings are faster than c++ strings! (sometimes): iliazeus.lol/articles/js-...

1 year ago 1 0 0 0

This is very 5head but super interesting! 🤩 It’s crazy how people learned to exploit things you would never think are exploitable in the first place... #javascript pure.tugraz.at/ws/portalfil...

1 year ago 0 0 0 0

it returns undefined, because return statement doesn’t allow line break right after return. thankfully, modern IDEs will most likely give you a squiggly warning or even error, depending on your settings.

1 year ago 0 0 0 0

the modern web yep 🤦‍♂️

1 year ago 0 0 0 0
Preview
Breaking down OpenAI's outage: How to avoid a hidden DNS dependency in Kubernetes Learn how to prevent Kubernetes outages by addressing hidden DNS dependencies and control plane issues. We break down OpenAI's recent incident, share key lessons from our own Kubernetes experience, an...

A very nice writeup on the OpenAI’s incident with #kubernetes control plane going down: render.com/blog/a-hidde...

1 year ago 0 0 0 0
Advertisement
Preview
Ingress nginx scaling to max due to memory · Issue #12167 · kubernetes/ingress-nginx Hi All, We observe a strange behaviour with the ingress-nginx pods in our production. We started observing the pods scaling to max due to memory usage. EKS: 1.29 helm list -n ingress-nginx NAME NAM...

Just faced this: Nginx ingress controller consumes a lot of memory during configuration changes (e.g. when creating ingresses). Which can lead to pods getting killed with out of memory error 😱

It is quite insane considering that NGINX is a very memory efficient server

github.com/kubernetes/i...

1 year ago 0 0 0 0

Some very interesting details there!
- to avoid a need for source maps, type annotations are replaced with spaces
- swc is used to do the actual stripping. one can say that swc is now shipped as part of Node.js 😄
- enums behaviour
- why tsx files are not supported

…and so on

1 year ago 1 0 0 0

I disable js in Chrome Dev Tools or use text browser e.g. lynx

1 year ago 1 0 0 0
Post image Post image

Today's daily challenge on leetcode is really hard! If you like to do some morning brain racking, this challenge is for you! 😅

I am actually quite proud I was able to solve it. Saw a guy on Twitch who streams leetcode challenges for 24 days in a row and he couldn't solve it 🤯

I used #typescript.

1 year ago 0 0 0 0
Preview
Can you fit Minecraft in a QR code? Answer: Yes! Here it is: The game launches, and you can move around the 64x64x64 world with WASD. Space is used to jump. Look around wit...

This is so cool… Minecraft that fits in a single QR code (2953 bytes): blog.allpurposem.at/minecraft-qr

1 year ago 1 1 0 0
Preview
1-billion row challenge with Node.js 5 minutes to 11 seconds with Node.js is possible?

I was fascinated by the 1-billion row challenge, but didn't think JavaScript would be the right tool for the job. It was great to see @jackyef.com's dive into it and achieve a 30x speedup from the baseline: jackyef.com/posts/1brc-n...

1 year ago 6 1 0 0
ts2c - Convert JavaScript/TypeScript to C

I also released ts2c 2.2.10 to npm - that's gonna be the last version based on TypeScript most likely.

The online demo at andrei-markeev.github.io/ts2c/ is using 2.2.10 for now.

1 year ago 1 0 0 0
Preview
GitHub - andrei-markeev/ts2c: Convert Javascript/TypeScript to C Convert Javascript/TypeScript to C. Contribute to andrei-markeev/ts2c development by creating an account on GitHub.

Just merged a massive change in ts2c, migration from TypeScript Compiler API to kataw - faster and more lightweight JS parser 🚀

Two weeks of hard work finally materialised. If I knew it would be that hard, I would probably never start 😅 But I did it 💪

github.com/andrei-marke...

1 year ago 1 0 1 0
Advertisement

Even though I despise dynamic forms, but I built a dynamic forms engine myself about 3 years ago, to replace manually built forms 🤷‍♂️

The use case literally demanded it.

It was a long onboarding wizard with huge amount of customization per location, and we had hundreds of locations.

1 year ago 0 0 0 0

Ah so it was form generation from a schema?

Yeah I wholeheartedly agree that in 95% cases it's better to make forms manually. Like write them in JSX. If non-devs want to do it, there's e.g. Figma and then devs can brush up the result.

However, there are different use cases too.

1 year ago 1 0 1 0

sounds actually like a cool project to me :)

I did "intelligent" forms several times, for React and Vue, but never had to work with AST transforms for this, typings were enough.

it might be challenging, but why horrible?

1 year ago 1 0 1 0

used it in ts2c: github.com/andrei-marke...

1 year ago 0 0 0 0
Post image

#typescript has a very handy feature: it can merge interfaces, even with external libs.

I regularly forget how to make it work with modules, so here's the reminder 😉

Btw: `declare global` is also super useful 😎

1 year ago 2 0 1 0

I am actually quite proud of myself:

1. Investing a lot of hard work and still being able to withdraw is not easy.

2. Learned quite a bit about #javascript performance from this exercise :)

1 year ago 2 0 0 0

Spent 2 days (ok, nights 🤪) rewriting type inference system in ts2c to a new "super efficient and more debugabble" implementation.

Measured performance. Unchanged 😅

Tried debugging it. Still very hard.

Rolled back the changes 🤷‍♂️

1 year ago 0 0 1 0
Advertisement
Documentation - Narrowing Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.

Person is not a class, you can't use `instanceof` on interfaces 😉

Type guards can be used instead: www.typescriptlang.org/docs/handboo...

1 year ago 6 0 2 0

Also don't forget to make sure that `NaN !== NaN` ! 😂

1 year ago 0 0 0 0
Preview
GitHub - ParksProjets/C-Preprocessor: This is a C like preprocessor for Javascript, using Node.js This is a C like preprocessor for Javascript, using Node.js - ParksProjets/C-Preprocessor

Combine this with a clone of C preprocessor in JS (and maybe GNU make as well) github.com/ParksProjets...

Currently we don't have any preprocessors in JS and we cannot easily eliminate e.g. debug logging from production bundle.

1 year ago 0 0 0 0
ES6 modules are dead, long live C preprocessor! Did you know you could use C preprocessor even for JavaScript files?

Yesterday stumbled upon this funny idea of using `#include` in JS to bundle files with C preprocessor, thought "haha, nice", and closed the tab.

I guess my brain kept thinking about it 😅 I woke up and now I think it is a really interesting idea actually 🤪

rreverser.com/es6-modules-...

1 year ago 1 0 1 0
screenshot of `git log` commands, the most recent commit named "migrate to kataw WIP" showing that there were 54 files changed, with 1927 insertions and 1457 deletions

screenshot of `git log` commands, the most recent commit named "migrate to kataw WIP" showing that there were 54 files changed, with 1927 insertions and 1457 deletions

Current status: fixed 700+ typescript errors, phew 😅

Doing a big ass migration from using #Typescript Compiler API to a faster and more compact js parser (kataw) in TS2C.

1 year ago 1 0 0 0