
Husband, father and JS software developer. 🧉
Argentina
Joined March 2016
- Tweets120
- Following2.2K
- Followers202
- Likes1.5K
Daniel Broder 🇦🇷 retweeted
Este artículo permite que cualquiera, con conocimientos técnicos o no, entienda cómo funcionan las redes. Qué pasa exactamente cuando hacéis clic en un enlace.
Tiene un currazo impresionante.
fazamhd.com/mental-models/ne…
Daniel Broder 🇦🇷 retweeted
40 Functional Programming concepts to learn.
Bookmark for later.
1. Algebraic Data Types (ADTs)
2. Pattern-matching
3. Higher-Order Functions (HOFs)
4. Closures
5. Immutability
6. Totality
7. Streams
8. Lazy streams
9. Stream fusion
10. Deforestation
11. Functor
12. Applicative
13. Monad
14. Parser Combinators
15. Applicative Validation
16. Semigroup
17. Monoid
18. Parametric Polymorphism vs Ad-hoc Polymorphism
19. Type Inference
20. Endomorphism
21. Isomorphism
22. Contravariant
23. Profunctor
24. Lens
25. Prism
26. fold
27. traverse
28. Recursion Schemes
29. Tagless Final
30. Recursion
31. Free Monad
32. Hash-Consing
33. Lambda Calculus
34. De Bruijn index
35. Expression problem
36. Functional Core, Imperative Shell
37. Smart Constructor
38. Make Illegal States Unrepresentative
39. Errors as values
40. Parse, Don't Validate
Daniel Broder 🇦🇷 retweeted
In the next version of Bun
Bun.serve() gets a simple builtin router. It supports params.
![import { serve, sql } from "bun"; import App from "./myReactSPA.html"; serve({ routes: { "/*": App, "/api/users/:id": async (req) => { const id = req.params.id; const [user] = await sql`SELECT * FROM users WHERE id = ${id} LIMIT 1`; return Response.json(user); }, "/api/users": { POST: async (req) => { // ... }, }, }, fetch: () => new Response("Not Found", { status: 404 }), });](https://pbs.twimg.com/media/Gj05utSagAAV14Q.jpg?name=small&format=webp)
ALT import { serve, sql } from "bun"; import App from "./myReactSPA.html"; serve({ routes: { "/*": App, "/api/users/:id": async (req) => { const id = req.params.id; const [user] = await sql`SELECT * FROM users WHERE id = ${id} LIMIT 1`; return Response.json(user); }, "/api/users": { POST: async (req) => { // ... }, }, }, fetch: () => new Response("Not Found", { status: 404 }), });
Daniel Broder 🇦🇷 retweeted
Bun v1.2 is here
bun.sh/blog/bun-v1.2
Daniel Broder 🇦🇷 retweeted
Replying to @EffectTS_
@EffectTS_ Beginners Complete Getting Started course is out now 🚀
From zero to building complete apps with effect
Type-safe, maintainable, testable apps, and it's just typescript 💯
Here is what you'll learn 👇🧵
typeonce.dev/course/effect-b…
Daniel Broder 🇦🇷 retweeted
🏁 BEGIN EXCLUSIVE appreciation thread 🏁
SQLite transactions are lazy by default -- they only take a write lock when necessary.
If your transactions start readonly and then upgrade to writes:
```
BEGIN
SELECT ...
INSERT ...
COMMIT
```
, it may be better to just declare it a write transaction from the start:
```
BEGIN EXCLUSIVE
SELECT ...
INSERT ...
COMMIT
```
Otherwise you risk the following:
1. Transaction A takes a read lock
2. Transaction B takes a read lock
3. Transaction A tries to upgrade to a write lock, but can't, B holds a read lock
4. Transaction B tries to upgrade to a write lock, but can't, A holds a read lock
5. Both transactions time out. No profit
If you expect the contention to be high -- lots of transactions trying to write at the same time -- BEGIN EXCLUSIVE is your friend.
With BEGIN EXCLUSIVE, the flow is:
1. Transaction A takes a write lock first
2. Transaction A commits, transaction B takes its write lock
3. Transaction B commits
What about WAL mode (write-ahead log journaling)?
Well, it gets subtly worse. WAL journaling mode gives you a great concurrency boost, because instead of allowing one writer or N readers, it allows one writer and N readers to execute concurrently.
There's a consistency price here though. WAL guarantees you snapshot isolation, which means that each transaction will see some consistent state of the database, and will only commit if there isn't going to be any conflict.
In particular, if we were to run transactions A and B in WAL mode, it can end as follows:
1. Transaction A takes a read lock
2. Transaction B takes a read lock
3. Transaction A upgrades to write lock
4. Transaction A writes some data
5. Transaction A releases the write lock
6. Transaction B upgrades to write lock
7. Transaction B tries to write data and gets a SQLITE_BUSY_SNAPSHOT error, because transaction A already changed the database, so there's a potential conflict.
That's optimistic concurrency -- we assume everything is going to be alright and proceed, and worst case we get an error and need to roll back.
Again, BEGIN EXCLUSIVE lets you opt-out of optimistic concurrency, if you know your workload has high contention.
There's also another flavor of transactions in SQLite - BEGIN IMMEDIATE, almost identical to EXCLUSIVE, and in fact totally identical in WAL mode. More details in official docs: sqlite.org/lang_transaction.…
Daniel Broder 🇦🇷 retweeted
If you go to chrome://settings/adPrivacy you can turn off the spyware that got inserted into the latest version of Chrome.
Daniel Broder 🇦🇷 retweeted
Introducing Bun v1.0 - a fast, all-in-one toolkit for running, building, and testing JavaScript and TypeScript
bun.sh/blog/bun-v1.0
Daniel Broder 🇦🇷 retweeted
Junto con @openqube abrimos la #encuestaIT de sueldos de julio ! tomate dos minutos para completarla. Al finalizar vamos a publicar la data y el análisis sysar.my/sueldos20202
Daniel Broder 🇦🇷 retweeted
One of my favorite software development practices is to wrap dependencies into custom abstractions.
I hate it when a third-party leaks all over my code and a refactor takes hours (if not days) because of it.
Daniel Broder 🇦🇷 retweeted
Llegué diez años tarde, pero ahora me entero que se puede usar cualquier cosa después del signo + para "crear" cuentas de prueba en Gmail.
Ej: Me puedo registrar como [email protected] en un sitio y me llega el mail a la cuenta [email protected]
Daniel Broder 🇦🇷 retweeted
Se viene una nueva edición, pero esta vez online !
🗓Cuándo ? Miércoles 27 de Mayo, 19:00hs.
🌐 Dónde ? En nuestro canal de youtube youtube.com/channel/UCosDO1D…
🗣Charlas de @M_Blayer y @mvaldesdeleon
❤️Vamos a enviarles un link para poder donar a LVDE
🔔No olviden suscribirse !

























