https://posting.sh/ | In terminal API client
It's keyboard driven and supports vim keys as well. Not the smoothest experience but still better than constantly switching between coding and fiddling with postman
It's keyboard driven and supports vim keys as well. Not the smoothest experience but still better than constantly switching between coding and fiddling with postman
❤1
"A little copying is better than a little dependency."
- Rob Pike
This is such a nice take. We mostly tend to be so strict about the DRY principle. Duplication is not always evil, nor it is always the root of evil. In fact a little redundancy in exchange for dependency is totally worth it.
Let's say you have multiple components that have their own build processes and operate separately with loose couplings between them. And now you can't stand that you have implemented a logic on both component A and component B. So you decide that there should be a dependency between these components.
You are slowly moving towards tight coupling, and while there are ways to avoid it (introducing a third component ,...), they tend to just consume more of your time and effort so you'd probably just let them be.
This will not only make changes have their effects distributed throughout your entire system, but will impact the build-process/run-time of your components.
#DRY #components
- Rob Pike
This is such a nice take. We mostly tend to be so strict about the DRY principle. Duplication is not always evil, nor it is always the root of evil. In fact a little redundancy in exchange for dependency is totally worth it.
Let's say you have multiple components that have their own build processes and operate separately with loose couplings between them. And now you can't stand that you have implemented a logic on both component A and component B. So you decide that there should be a dependency between these components.
You are slowly moving towards tight coupling, and while there are ways to avoid it (introducing a third component ,...), they tend to just consume more of your time and effort so you'd probably just let them be.
This will not only make changes have their effects distributed throughout your entire system, but will impact the build-process/run-time of your components.
#DRY #components
👍2
I can now confidently say gaming has been made possible in linux. Thanks to proton you can now play most of your favorite AAA games out of the box (or with minimal tweaks).
A common issue for me was screen-tearing which was solved by using a compositor called picom and enabling its vsync feature.
If you are a dual-boot user like me and can't let go of your windows, may this be a sign
A common issue for me was screen-tearing which was solved by using a compositor called picom and enabling its vsync feature.
If you are a dual-boot user like me and can't let go of your windows, may this be a sign
You can play doom on PDF!
https://doompdf.pages.dev/doom.pdf
Quoted from the repo:
The PDF file format supports Javanoscript with its own separate standard library. Modern browsers (Chromium, Firefox) implement this as part of their PDF engines ... C code can be compiled to run within a PDF using and old version of Emnoscripten that targets asm.js
https://doompdf.pages.dev/doom.pdf
Quoted from the repo:
The PDF file format supports Javanoscript with its own separate standard library. Modern browsers (Chromium, Firefox) implement this as part of their PDF engines ... C code can be compiled to run within a PDF using and old version of Emnoscripten that targets asm.js
What the hell is a tree-sitter and how is it any different than language server?
- What's a language server?
They're like compilers but with extra features meant for editors. The fact that your current text editor can show you where you have a function signature mismatch or you have an unused variable in another file or you can simply jump to the definition of the variable you're hovering, means they have some knowledge of the language and actually have gone through your code. This can be achieved via communicating with a language server (usually provided with the language tools). They all follow LSP interface so if an LS exists for your language, your editor can communicate with it.
- What's a tree-sitter?
Tree-sitter is a syntax parser much like the parsers used in compilers. It provides editors with details about the current file syntax and structure. It will aid editors to have better syntax-highlighting, folding features, jumping to function arguments, ...
- The difference:
You can see that a language server is capable of doing everything a tree-sitter can do and more. So why do we even have tree-sitters? They are fast. that's it. They only consider your current file (not the whole project like language servers) and they can provide your editor with useful information on a matter of keystrokes.
If you are interested in how tree-sitter works in general, This article is a good read
- What's a language server?
They're like compilers but with extra features meant for editors. The fact that your current text editor can show you where you have a function signature mismatch or you have an unused variable in another file or you can simply jump to the definition of the variable you're hovering, means they have some knowledge of the language and actually have gone through your code. This can be achieved via communicating with a language server (usually provided with the language tools). They all follow LSP interface so if an LS exists for your language, your editor can communicate with it.
- What's a tree-sitter?
Tree-sitter is a syntax parser much like the parsers used in compilers. It provides editors with details about the current file syntax and structure. It will aid editors to have better syntax-highlighting, folding features, jumping to function arguments, ...
- The difference:
You can see that a language server is capable of doing everything a tree-sitter can do and more. So why do we even have tree-sitters? They are fast. that's it. They only consider your current file (not the whole project like language servers) and they can provide your editor with useful information on a matter of keystrokes.
If you are interested in how tree-sitter works in general, This article is a good read
Penpot | Free and open-source figma-alternative
I've self-hosted this and trying it out.
https://penpot.app
I've self-hosted this and trying it out.
https://penpot.app
👍2
Chat with AI without privacy concerns
https://jan.ai
Jan is an open-source GUI which let's you chat with different AI models locally (offline) using your own hardware, like ollma.
https://jan.ai
Jan is an open-source GUI which let's you chat with different AI models locally (offline) using your own hardware, like ollma.
🎄1
Here is my understanding of what is UDP hole-punching and how does UDP Peer-to-Peer connection work
As you may know our devices are behind a NAT process when trying to access the internet. Meaning multiple devices on the same private network (e.g your local wifi) will have the same public IP address while on the internet. So in order for the router to know which packet is destined to which device, there must be a translation table that has records like: (DestinationAddr, DestinationPort, LocalAddr, LocalPort). You can find out more about NAT here
The problem is now clear. If we wanted a Peer-to-Peer connection, clients would have no idea of each others NAT tables hence no idea of where they should send their packets to. In fact there is not even a suitable record in their NATs for this procedure.
That's when a third server (S in picture) comes into play. S should be exposed to both A and B, meaning it should have a public UDP port open for sending/receiving packets and the rest goes as follows:
1. A and B will attempt to send UDP packets to S, hence they would have a record in their router's NAT table for an open UDP port
2. S will aid to exchange A and B's public address and port
3. Both A and B will now attempt to send a UDP packet to each other without using S and in doing so they would add another entry to their NAT tables. Bear in mind if a packet is received without any packet sent first, it will be dropped. Since the NAT entry is not initiated yet but it does not matter since it will be initiated when sending one anyways
4. After all said and done, A,B can freely send packets to each other via UDP
TCP hole punching works about the same but for UDP it's simpler since it's connection-less
As you may know our devices are behind a NAT process when trying to access the internet. Meaning multiple devices on the same private network (e.g your local wifi) will have the same public IP address while on the internet. So in order for the router to know which packet is destined to which device, there must be a translation table that has records like: (DestinationAddr, DestinationPort, LocalAddr, LocalPort). You can find out more about NAT here
The problem is now clear. If we wanted a Peer-to-Peer connection, clients would have no idea of each others NAT tables hence no idea of where they should send their packets to. In fact there is not even a suitable record in their NATs for this procedure.
That's when a third server (S in picture) comes into play. S should be exposed to both A and B, meaning it should have a public UDP port open for sending/receiving packets and the rest goes as follows:
1. A and B will attempt to send UDP packets to S, hence they would have a record in their router's NAT table for an open UDP port
2. S will aid to exchange A and B's public address and port
3. Both A and B will now attempt to send a UDP packet to each other without using S and in doing so they would add another entry to their NAT tables. Bear in mind if a packet is received without any packet sent first, it will be dropped. Since the NAT entry is not initiated yet but it does not matter since it will be initiated when sending one anyways
4. After all said and done, A,B can freely send packets to each other via UDP
TCP hole punching works about the same but for UDP it's simpler since it's connection-less
❤2👌2
This is essentially how WebRTC works under the hood. Congratulations, you now know how to punch a UDP hole just like how you punch a hole in your table while you can't to get it to work.
❤1😁1
ScamMinder | Ai powered scam detector
It is actively updated and actually provides details about the total score of a website
https://scamminder.com/
It is actively updated and actually provides details about the total score of a website
https://scamminder.com/
Some compilers are so strict (like your mom) that we might say
Therefore exists another way of writing software called CDD or Compiler-Driven Development. Much like TDD but instead of your tests giving you the green light, you obey the compiler. It's highly feasible in Rust due to its type system and strict ownership rules.
This methodology can be summarized as:
> Write client code for your module even though it doesn't exist
> Figure out its model/interface
> Compile and face errors
> Errors bad, Life sad, Write code to get rid of errors
> Improve your model and repeat
> Hate yourself for choosing rust
if it compiles, it probably works
Therefore exists another way of writing software called CDD or Compiler-Driven Development. Much like TDD but instead of your tests giving you the green light, you obey the compiler. It's highly feasible in Rust due to its type system and strict ownership rules.
This methodology can be summarized as:
> Write client code for your module even though it doesn't exist
> Figure out its model/interface
> Compile and face errors
> Errors bad, Life sad, Write code to get rid of errors
> Improve your model and repeat
> Hate yourself for choosing rust
😁5