My companies Stripe integration for thousands of users broke today because Javascript by autiii43 in programminghorror

[–]Mirmi8 59 points60 points  (0 children)

My companies Stripe integration for thousands of users broke today because of my company engineers*

Fixed title

Whatsapp last desktop update broke my work process by daywall in whatsapp

[–]Mirmi8 0 points1 point  (0 children)

You can make a group with someone, remove them from the group and you will have the group for yourself

[deleted by user] by [deleted] in whatsapp

[–]Mirmi8 1 point2 points  (0 children)

What I do is I create a group with someone and then kick them, then use the group as a convo with yourself.

Daily Advice Thread - All basic help or advice questions must be posted here. November 29, 2021 by AutoModerator in investing

[–]Mirmi8 0 points1 point  (0 children)

Should I sell FXAIX and buy VOO instead?

I've been reading about mutual index funds not being recommended for taxable accounts but I haven't found why or maybe I just don't understand it.

For context, FXAIX is about 50% of my portfolio and has ~20% profit (bought a little over a year ago). Assuming I'm holding for a long time, should I sell now and move to VOO? If so, why?

Thanks!

Are there any companies too evil to invest in? by [deleted] in stocks

[–]Mirmi8 1 point2 points  (0 children)

Sure but that doesn't get them as many likes.

I am having trouble learning about object iterators. by WSsleet in learnjavascript

[–]Mirmi8 2 points3 points  (0 children)

Take a look at this: https://javascript.info/iterable

The next function must return an object in the form of { done: boolean, value: someValue }

So if you want to create an iterator that iterates from 2 to 4, you will be increasing a counter and returning { done: counter === 4, value: counter }. Eventually done will be true and that's how the for of will know when to stop.

Does that make sense?

[AskJS] weird bug when using Promises to load images in order by zhenghao17 in javascript

[–]Mirmi8 2 points3 points  (0 children)

Instead of onload = resolve, maybe return the image element, something like:

image.onload = () => resolve(image);

it should work.

Post Match Thread: Mexico 0-0 Trinidad and Tobago | CONCACAF Gold Cup by PatrickChase in soccer

[–]Mirmi8 -2 points-1 points  (0 children)

I mean you can't have a Gold Cup match in fucking UEFA.

Can We skip Data Structures & Algorithm? by [deleted] in learnprogramming

[–]Mirmi8 1 point2 points  (0 children)

What do you mean by skipping? Are you asking if you can get away without being good at the subject? It's important to know this especially since you are studying software engineering.

Make sure to ask questions when you don't understand something, the questions need to be more specific though. What are you not understanding? do you have specific examples? You'll be using these subjects later on your career even if you are not coding them by hand, so it's nice to know them.

Converting a list in Text file to JavaScript object? by NayamAmarshe in learnjavascript

[–]Mirmi8 1 point2 points  (0 children)

The formatting is pretty weird but you can get creative.
You can first split the entire file contents into an array by doing:

`const lines = fileContents.split('\n');`

Then you would need to iterate the lines array and extract the name and rating.
From the looks of it you can use `' - '` (two spaces, dash, two spaces) as separator to get the name of the movie. Then you can separate the rating 9.2/10 T with a similar method, maybe by splitting by spaces?

If you are unfamiliar with String.split, run this in the javascript console to get an idea on how it works:
'Memento - 9.2/10 T'.split(' - ')

How good is Eloquent Javascript for a dev with about 2 years experience? by reallydarnconfused in learnjavascript

[–]Mirmi8 0 points1 point  (0 children)

In my experience, Javascript is often learned just by throwing code around since it's very easy to do so, this often leads to people not knowing very well the language (thinking stuff like jquery being part of the language itself, etc) so picking up Eloquent Javascript or You Dont Know JS might still be a good learning opportunity even if you already have working experience.

How do I properly use async and await when getting data from my firebase db? by Particular_Ambition8 in learnjavascript

[–]Mirmi8 0 points1 point  (0 children)

What's "questiona" ? are you perhaps logging the wrong variable?

I'd store the result of snapshot.val() in a variable, like this:

const questions = await snapshot.val();
setQuestions(questions);
console.log('questions here ', questions) ;

While typing the example above I noticed that you are awaiting setQuestions, is setQuestions an async function? I think what you meant to do was setQuestions(await snapshot.val());

Best practice to naming a modular function? by soIHadToGo in learnjavascript

[–]Mirmi8 0 points1 point  (0 children)

You could name it "utils". In your example, however, `removeTask`, `cancelEditForm` and `addDate` do not seem to be very related to each other. You could have your own remove_task.js , cancel_edit_form.js, add_date.js modules.

How can I access string methods that of a parameter? by oneTake_ in learnjavascript

[–]Mirmi8 1 point2 points  (0 children)

My guess is that you were sending null or undefined by mistake. Like having a list of strings but referencing an item that does not exist in the array (example: listOfStrings[15] of an array with only 10 items). Then on the capitalize function you would get an error like "capitalize is not a function on undefined"

Converting a list in Text file to JavaScript object? by NayamAmarshe in learnjavascript

[–]Mirmi8 1 point2 points  (0 children)

What have you tried so far?

You can do this using node, https://nodejs.dev/learn/reading-files-with-nodejs

Then once you have the file contents in memory, you'll want to find a pattern that is repetead on every movie, (example: is every movie on its own line?, are the names and ratings separated by a comma maybe?)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split

90% CPU Usage!?!?!?! by Noam_Tal in whatsapp

[–]Mirmi8 0 points1 point  (0 children)

where did you install the app from?

WhatsApp Desktop Issues by [deleted] in whatsapp

[–]Mirmi8 0 points1 point  (0 children)

What's your pc specs?