• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: July 9th, 2023

help-circle





  • Mmm do you know Linux containers? Like Docker containers, for example?

    You need to understand Linux namespace and Linux containers to understand this trick. It isn’t super advanced to be honest, just a Linux feature that is very useful.

    It can be overwhelming if you haven’t worked with containers before: https://youtu.be/fTcit7F5Bcg?si=rQlq0mJyapIpOlx8

    Basically you can have multiple “network stacks” in the same machine, and they are isolated. By network stacks I mean things like the netfilter rules and the routing rules.

    So, if you deploy a VPN inside a network namespace that isn’t the host’s namespace, the host won’t route the traffic to the VPN by default. Only the processes that are attached to that network namespace will process the network packets with the netfilter and routing rules of that namespace. So, if you only attach the Firefox process to the network namespace of the VPN, only the traffic generated by that process will go through the tunnel.



  • People creating functions as objects inside of other functions. A few days ago saw a person create a function with two object functions inside, then passed one of the functions as an argument to the other function. Then returned the second function.

    It’s hard to find such a mess in other languages. Yeha, functions as objects are cool. Closures are also cool… But why abuse that shit?


  • Come on, Javascript is pretty nasty. Trying to read that shit always gives me brain tumors. Why do they need to wrap every fucking thing in a function inside a function inside a function that is passed as a parameter to a function inside another function?

    Like, bro, you know people are meant to understand what you just wrote?

    It just gives too much freedom and people forget they need to write code that is easy to read for people who aren’t totally familiar with the code base.

    They even bring that shit into typescript. Like they are already using a language that is meant to fix that shit and they are like, nope, let me create 5 nested functions just because.