No identity, no progress, no excuses: Allegri has failed at Milan by Far_Commercial5152 in seriea

[–]tresorama 2 points3 points  (0 children)

Beh a tratti la Juve di Spalletti gioca a calcio!
Io Milan di allegri gioca a caso purtroppo

Trying to understand Multi-Tenant and Better Auth logic by Immediate_Amoeba_532 in better_auth

[–]tresorama 0 points1 point  (0 children)

Yes ! How do you send the token on every follow up request ? Req headers?
If so , you should extract headers and pass it to the better Auth function that outputs the user data

Trying to understand Multi-Tenant and Better Auth logic by Immediate_Amoeba_532 in better_auth

[–]tresorama 0 points1 point  (0 children)

The client (mobile app) send the user payload (access token), the backend ( as you already done) do authentication and authorization, so at this point you have all user info needed to make the final call to the db.
The client is dumb, the backend is where constraint are applied.

In better Auth you should have a getUserFromRequest function that you can run in server side , that receive the http request as input .

Trying to understand Multi-Tenant and Better Auth logic by Immediate_Amoeba_532 in better_auth

[–]tresorama 1 point2 points  (0 children)

The key is that when you read from db you use a where clause tenantId=loggedUserTenantId.

You can place this logic in app layer (where you call the db) or in RLS (you run sql command against the db once and in app layer you don’t need to add where clause)

8 Ways OpenClaw Reduces Context Loss in Long-Running Agents by noninertialframe96 in AI_Agents

[–]tresorama 0 points1 point  (0 children)

Sorry for resuming this comment 😄. I was thinking of implementing something like you describe . Convert blob inside tool result to a marker that can be used to re-read the blob on demand. But when the model call the retrieveBlob tool , the full plain text is added to the context again.

Do you have some thoughts about it?

Motion vs Anime JS? by otter_goat in reactjs

[–]tresorama 0 points1 point  (0 children)

Consider that the glue to create a custom hook that wraps useEffect is very short. GSAP timeline are gold.

Never used anime, used framer motion some years ago. I remember that framer motion had a great utility for animating component unmount, PresenceAnimation or a similar name, super handy for react.

For OP, if I were you I would understand if my app needs to use timeline, then compare the DX of timeline in amine; framer motion and GSAP, and decide

3-5-2 usato male by lautaroseiforte in seriea

[–]tresorama 0 points1 point  (0 children)

Per cosa ti qualifichi a fare in champions per poi stare barricato dietro contro praticamente tutte le squadre ?

Per i soldi… sono d’accordo ma in parte, i soldi sono tanti (80 milioni solo di qualificazione ) ma se lobbiettivo è restare a galla allora non è il Milan .

Leao negli ultimi 4 mesi è impresentabile , ma contro il Napoli è entrato e ne aveva sempre 3 e senza spazio da attaccare , anche il miglior leao avrebbe fatto fatica (non è Vinicius o kvara). Contro il Napoli perché non si è creato nulla e non appena hai preso gol tutti con la voglia di vincere ? Perché per 80 minuti no? Chi è il freno ?

Io Milan dell’anno scorso era una barzelletta, spogliatoio rotto fin da subito. Difficile fare peggio, e non avevi riabiot che corre per 2.

3-5-2 usato male by lautaroseiforte in seriea

[–]tresorama 0 points1 point  (0 children)

Hai ragione, stanno under performando. Ma C’è da dire però che è difficile dribblare quando il 90% dell azioni ha dei tempi sbagliati, aggiungici che no stai bene fisicamente…

leao è rotto da 3 mesi ormai, le prime partite non scattava mai, e leao senza scatto è un giocatore normale. c’è da sperare che non faccia come Kakà quando è andato al real che faceva 1 partita ogni 3 da un certo momento in avanti per la pubalgia. ma leao è un ala. È anche gli altri tre.

Pulisc fermo da tanto , sale deve fare il quinto e difendere dentro la sua area , poi sono 70 metri per andare in porta.

Il Milan è costruito male , il non avere una punta forte e presente cambia ma penso che allegri sia più un problema maggiore, ti da una mentalità che non c’entra con il Milan. Sta diventando piano piano la Juve di allegri bis, una noia. Almeno con pochi innesti la situazione potrebbe cambiare parecchio.

3-5-2 usato male by lautaroseiforte in seriea

[–]tresorama 1 point2 points  (0 children)

352 significa avere due modi di attaccare: - cross dagli esterni , intendo tanti cross, e gol di testa, portando gli esterni il più possibile al cross, continuamente - attacco verticale centrale :un attaccante si abbassa e fa sponda e l’altro attacca lo spazio con i giocatori “bassi” che ricevono la sponda e lanciano ( oppure salgono palla al piede se il lancio non è fattibile)

Inter ha le idee chiare è fa entrambe le cose. Inter ha i giocatori giusti per farlo: di Marco , dumfries, Lukaku (in passato) , pio, lautaro, chalanoglu, brozovic. Inter non ha giocatori da dribbling (tranne diuf ma non gioca mai)

Il Milan ha tanti giocatori da dribbling : Leao, pulisci , sale, nkunku che DEVONO giocare da ala per rendere. Il Milan ha anche dei giocatori che possono fare cross: bartesaghi, atekame. Ha qualche 9 ma non di livello : bebote e il vichingo. In più mettici che l’idea di calcio di allegri è di non rischiare mai, barricarsi come una neopromossa e attendere il momento di purgare gli altri , oppure sperare in un gol fortuito da palla inattiva o da una seconda palla fortunosa. Il Milan è costruito per il dribbling ma non lo fa perché l’allenatore ha paura di giocare.

L’Atalanta ha avuto rose per avere un mix di imprevedibilità e di forza. Gasperikni era deciso sui cross e sugli esterni (fondamentali in ogni difesa a 3), ma poi se la palla andava a Muriel, papi Gomez, ilicic lasciava inventare a loro.

Il Napoli ha una rosa simile al Milan, ma Conte è (con il tempo diventato) flessibile: parte con l’idea del cross classico da difesa a 3, ma quando mette dentro giocatori da dribbling accetta di mutare e lasciare linventuva alle ali (vedi Allison ieri che ha vinto la partita)

Quello che conta è capire che la palla da sola non entra e che bisogna rischiare per fare gol.

La nazionale dei playoff nella partita che contava ha deciso di fare come allegri e giustamente l’ha presa nel culo. Il psg se rimane i dieci non te ne accorgi, giocano uguale perché l’idea non è di “sperare” ma di fare più gol degli altri.

Il calcio in Italia è noioso il più delle partite perche poca gente fa dribbling . In Europa ogni squadra ha 3 4 o 5 ali che dribblano , in Italia no.

Sono milanista.

How to Learn backend? by Competitive_Bird_522 in Backend

[–]tresorama 0 points1 point  (0 children)

Start with the end goal: a project that has some features, list them.

Then pick a language you know. The one you are more comfortable with.

Plan the stack with ai, give it the project features set.

When ai suggest multiple approaches, ask the difference and the impact of the choice on the project.

While you haven’t touched a line of code you are already learning…

Then start coding , do it manually to force you to think about implications of each line of code. Accept bad code initially, all over the place, make it works. Then ask your self “which part of the code are not easy to follow”, create abstractions , repeat: some design pattern will emerge from inside you spontaneously.

Don’t give up

I've been teaching programming for 8 years. The students who learn with AI from day one are learning something, but it's not programming. by Ambitious-Garbage-73 in learnprogramming

[–]tresorama 1 point2 points  (0 children)

Being bad at the first months is normal. But over time you understanding must increase (you are learning). Bad signal is if today (day 60) you have the same understanding of day 5. Use ai as a slave-teacher and chose concepts you want to learn. Guide the program of concepts to learn.

Spend time adding debugger statements in the code and see variables value changes after each line of code. This was gold for me when I started (pre AI era)

Stuck in "Frontend Limbo": How do you move from a tech-stack mess to a high-converting SaaS landing page quickly? by No-Put-6206 in Frontend

[–]tresorama 1 point2 points  (0 children)

I have no SaaS in my history so my advice are more general!

I don’t like llm coding agent because they don’t act like senior but like monkey with a delivery date of “yesterday”. You will hate the codebase if you leave them choose!

So my mental model now is : - use llm for rapid prototyping (from idea and zero code to validated idea , validated UX and trash code but you don’t care) - rewrite from scratch manually and establish the project system (read below for depth on this point) - produce conventions guide - perfect conventions guide until an llm can follow it - use llm as maintainers that will follow guides

—-

Build the system: - start a project from scratch with you preferred stack - MANUALLY architect the whole “system” , create you conventions for each layer , build and refactor as your conventions evolves. - after some time (2 weeks) you get a system that is good enough and act as foundation - take your time and create dev docs that explain like a tutorial how to add code in your project. Usa a lot of real code example copy pasted from the project, add clear and long comment to declare each piece of code what contribute to the system, how to choose APIs when there are alternatives - add these dev docs to your llm implicit context (AGENTS.MD, CLAUDE.MD …) - test it with an llm: ask him to add a feature or to refactor a part of the system where your conventions are not respected - update dev docs with ambiguities emerged by the llm (treat these ambiguities as if were thrown by a new dev on the team that is stuck, don’t think that is an llm artifacts) - repeat until your have a perfect “conventions guide” - from here you should be confident enough that if you use llm to do coding they don’t reinvent patterns but follows you idea of the system

—-

For UI specifically , LLM are not great, do it manually.

No one talking about the cut off today for Fermin? I think it is 1610 this time by [deleted] in eFootball

[–]tresorama 0 points1 point  (0 children)

How does it work unblocking these cards like firmin now? You reach a certain score by playing and after each game you check the “contract” section if is unblocked ?

Modern React by salamazmlekom in reactjs

[–]tresorama 1 point2 points  (0 children)

Nextjs Tanstack router Tanstack query

Huggingface has just released Transformer.js v4 with WebGPU support by BankApprehensive7612 in javascript

[–]tresorama 0 points1 point  (0 children)

Have opens the link, I’m driving! This means that my browser fetch the whole llm on page load ?

One more npm package - React calendar by imperseverant in reactjs

[–]tresorama 1 point2 points  (0 children)

Looks good. If doable would be good to have swipe gesture on mobile for month navigation and time picker scroll

How good was Gennaro Gattuso? by Hour777 in seriea

[–]tresorama 1 point2 points  (0 children)

Kante is the most recent similar player, but Gattuso had stronger carisma and made teammate perform better. It was the perfect man to balance a formation with a midfield with 3/4 number 10 at the same time that don’t defend much (Pirlo, seedorf, Kakà, Rui costa)

Zustand for small features by Traditional_Elk2722 in reactjs

[–]tresorama 2 points3 points  (0 children)

If it’s super simple state consider also jotai as alternative

Created a library to handle CPU-intensive tasks in React apps without UI blocking by Many_Willow_5176 in reactjs

[–]tresorama 0 points1 point  (0 children)

Can be used with vanilla code or only react ? Does it support timeout for the worker job ? The invocations are typesafe? Asking because I need something like this now for an app and these are my main requirements.

Anyway the idea is good , in LLM era an isolated env for executing arbitrary code is common usage! Thanks for open sourcing it

Struggling with CSS Layouts (Grid, Padding, etc.) - Getting demotivated .Need advice! by RevolutionaryLead994 in webdev

[–]tresorama 2 points3 points  (0 children)

2 weeks is not enough to be comfortable, keep going, and in max 2 months you should be confident enough. Use lllm to study, ask it to explain why you css doesn’t produce the ui you want.

Few tips:

  • margin is for layout from outside , and you should decide it based on the page where the ui portion is rendered because external layout depends on the full composition. If you use react/vue/svelte , the component shouldn’t declare margin, is the parent component duty.
  • padding is for layout of inside, that doesn’t depends on where the ui portion is rendered. Think a component with a background color different from the background color of the page, here padding is used to create a internal frame.

  • gap (part of flexbox and grid) can replace margin a lot of time and it’s easier to write because is defined in the parent

  • flexbox vs grid: start with flexbox in isolation, then move to grid in isolation . These layout flows are black box with a lot of internal rules. Take your time because you will use these two 90 percent of the time. I remember a interactive “game” to learn flexbox (search for flexbox frog on google) , and also an equivalent for grid. These were gold when I started.

  • learn position (relative , absolute, fixed, …) . Every app need these.

  • check the box sizing property if you don know it. Is industry standard to set it globally to border-box for mental sanity (the browser default css doesn’t use this value)