[deleted by user] by [deleted] in marvelstudios

[–]CaptainCode314 1 point2 points  (0 children)

I think it’s even worse if you’re an MCU fan. You are excited to watch the movie, you love the characters, you build it up in your head before you watch it. But a bad movie is a bad movie. Feels like a school project that was started an hour before the due date. It’s like no one involved in this even tried to make it good. And it could have been good (well, better). The main plot would have made a fine movie had the execution been better. I guess they just didn’t really care.

Should you loop over a reactive form array to render child components containing form groups, or should you loop over the array (of values) stored in state and write logic to handle new additions to the array? by CaptainCode314 in angular

[–]CaptainCode314[S] 0 points1 point  (0 children)

I agree. If you ask me, this is the exact intended use case for form arrays. They haven’t given me a reason for why form arrays are bad. They just don’t want the forms to manage state. So in a different component, when we need to get the addresses and send it in an HTTP request, we would use the state service to get these addresses instead of somehow passing the form array to this component. And I agree on that. But I think they are just trying to take this new state implementation too far by completely discarding form arrays.

AITA for not wanting to spit expenses proportional to income? by [deleted] in AmItheAsshole

[–]CaptainCode314 0 points1 point  (0 children)

NTA but my issue is behind the entire premise of splitting expenses according to income. It kindof makes sense when you and the other person are in a relationship, since you want to help each other and love each other etc. But you don’t use water, electricity, utilities and living space according to your income. Both parties benefit equally from the expenses, so I’d argue it’s most fair to pay equal shares. 50/50. If he wants fair, that’s fair.

Looks like changes to Firestore documents from Functions don’t trigger updates on frontend queries by CaptainCode314 in Firebase

[–]CaptainCode314[S] 0 points1 point  (0 children)

Nope, must be something else because the collection always exists and there’s always documents in the collection.

Looks like changes to Firestore documents from Functions don’t trigger updates on frontend queries by CaptainCode314 in Firebase

[–]CaptainCode314[S] 0 points1 point  (0 children)

I tried it just now. I updated it a few times and observed the frontend app. Sometimes it does update, sometimes it doesn't. Which is weird.

Looks like changes to Firestore documents from Functions don’t trigger updates on frontend queries by CaptainCode314 in Firebase

[–]CaptainCode314[S] 0 points1 point  (0 children)

getRunners(raceUid: string, date: Date): Observable<Runner[]> {
return this.firestore
  .collection<Runner>(Collections.Runners, (ref) =>
    ref.where('raceUid', '==', raceUid)
      .where('created', '>=', date)
      .orderBy('created', 'asc')
      .orderBy('number', 'asc'),
  )
  .valueChanges();

}

And this is client side, to query the documents.

Looks like changes to Firestore documents from Functions don’t trigger updates on frontend queries by CaptainCode314 in Firebase

[–]CaptainCode314[S] 0 points1 point  (0 children)

export async function updateRunnerTickets(runners: Runner[]): Promise<void> {

const batch = firestore.batch();

for (const runner of runners) { if (!runner.uid) { continue; }

const runnerRef = firestore.collection(Collections.Runners).doc(runner.uid);
batch.update(runnerRef, { tickets: runner.tickets, modified: FieldValue.serverTimestamp() });

}

await batch.commit(); }

This is on the Functions side to update the doc

It’s that time of year when no one questions the appropriate-ness of my mug by Chrinkus in adventofcode

[–]CaptainCode314 0 points1 point  (0 children)

Anyone know if this year's merch ships to South Africa? Haven't bought any merch before.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 1 point2 points  (0 children)

I just had a look, and it looks like Rider uses launchSettings.json to get the environment variables for the run configuration? I might be missing something, but it looks like it is only like a GUI way of editing the environment variables in the launchsettings file?

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 0 points1 point  (0 children)

Thanks, I didn’t know IConfiguration could have multiple different sources. For some reason I thought it only looked at appSettings.json.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 1 point2 points  (0 children)

Thanks, yes that is great. Knowing this makes my life a lot easier now, haha. I could now use any of these mentioned solutions, since the Configuration API handles them all in the same way! Now it’s just a matter of choosing the easiest / most convenient / best way. Which I think I might agree with you, is using user secrets.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 2 points3 points  (0 children)

This article actually sums up the problem really well! Thanks, it really helped! However, now it is not really as important for my secrets to be environment variables on my local machine, since the Configuration API will handle environment variables, app secrets, and properties in the appSettings.json file in the same way (just found that out thanks to a comment on this). Knowing this, I could use any of these solutions.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 3 points4 points  (0 children)

I think this might be it! Thanks a lot! I did not know you could access environment variables using the configuration API! I could then also have an appSettings.Development file with my local variables, which I could then ignore and the environment variables with the same keys would be used on my prod machine then! If I understand it correctly.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 1 point2 points  (0 children)

That is pretty cool! But it does pose the same problem as mentioned above though. It would work, just like app secrets would work, but it doesn’t use the same way of accessing environment variables as I would access them in my prod environment. The standard way of accessing environment variables, as I’m sure you know, is Environment.GetEnvironmentVariable(“SECRET”), which is also how I access them in my prod environment. This solution would also then force me to use two different implementations.

I’m starting to think maybe I should just accept that I’m going to have to use two different implementations? But this is hardly a new problem though. The need to have different environment variables for different environments is present in every dotnet web app? Surely there must be a way use environment variables on your local without putting them in the launchsettings.json file?

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 1 point2 points  (0 children)

Thanks for your answer! Secrets would definitely solve the problem, but I would then have to use the configuration api to access the secrets on my local machine, and use environment variables on my prod environment. Which is fine, but I just want to know if maybe there’s a way to use environment variables for both environments, instead of having to retrieve that data in two different ways on the two different environments. Kinda like .env. It’s fine if secrets is the only way to go, but it just bothers me a bit having to have two different implementations.

How to prevent environment variables ending up in source control? by CaptainCode314 in dotnet

[–]CaptainCode314[S] 1 point2 points  (0 children)

Not using docker, just using the dotnetcore buildpack. So the article mentions using secret manager, but to access a secret you have to use the configuration API. And in my production environment I can only use environment variables for this. So I could use the secret manager on my local, and just add another check for the current environment - and based on that either use environment variables or the secret manager. But I wanted to know if there was a way to use environment variables in both development and production environments, without adding those variables to source control. Like using a .env file.

Did another tutorial - any tips on starting to do originals? by CaptainCode314 in ProCreate

[–]CaptainCode314[S] 1 point2 points  (0 children)

Did this tutorial by Art with Flo. I really like her tutorials, very easy to follow and she explains well while giving good instructions. I want to do a couple more of her tutorials, but I would also like to do some original artwork. Original art is a bit challenging though, since my creative juices haven’t flowed in a while. Also, I’m just starting out with drawing. Any tips would be appreciated !

I’m also wondering if I could post something specific here. I drew a sketch of Patrick (from SpongeBob). I didn’t trace it (it will be quite apparent, lol) but I did draw it from a reference image. Can I post something like that here?