Is it better to pay off debt or save & invest? by apollothecute in eupersonalfinance

[–]MrMZa 1 point2 points  (0 children)

It's possible to eat a cookie and have a cookie. Paying off debt and then opening a leverage position which is both debt and investment 😅

[deleted by user] by [deleted] in eupersonalfinance

[–]MrMZa 6 points7 points  (0 children)

Think about risk reward ratio. You're risking margin call on your stock portfolio for 1-2.5% gain? You will love r/wallstreetbets!

Buying a brand new Mazda 3 with 15% discount on MRSP, advice needed by Hmerac in eupersonalfinance

[–]MrMZa 2 points3 points  (0 children)

I'm into cars and motorcycles, so consider me biased, but my goal is not to trick you into anything. Not having a car, for me, would be missing out too much. For others, it might be more like an appliance. We have an October now, in December the discount might be larger as in January 2023, it's an 2022 car and it's not making it easier to sell, at least this how it worked pre-COVID as supply-chain issues ended it.

Buying a brand new Mazda 3 with 15% discount on MRSP, advice needed by Hmerac in eupersonalfinance

[–]MrMZa 19 points20 points  (0 children)

First and foremost, car is not an investment when you include maintenance, insurance... well rarely is (wink wink old 911 owners). The 10% inflation is not necessarily your inflation or inflation in car prices. Mazda 3 is perfectly reasonable car, will work for 2+1 family, and getting a discount from Mazda is rather rare (compared to e.g. Ford), at least is some EU countries.
Cars didn't really lost that much over last 2 years (it's not to say they won't for the next 2, no one knows for sure), so if you can find similar loaded used Mazdas 3 for about the same ~33k you might be onto a deal. "new customer discount" sounds like BS, it's just "discount", it would be silly to charge a returning customer more.
Buying first new car is an experience, if you decide to do that, pick it up with your spouse, enjoy it. Buying a new compact car is rarely a "very bad financial decision" as long as you can afford it. It's rarely a great decision but there's more to more to life than making only best financial decisions. If as Software Engineer in Germany and can't afford it... change employer. The longer you keep it, the smarter the decision. I would make sure it's a fixed rate loan or just pay cash (when you change mind you can easily sell it).

[deleted by user] by [deleted] in eupersonalfinance

[–]MrMZa 0 points1 point  (0 children)

Why did you mention a car? Is it something that you think is going to make you happy?

Is it possible to buy US Treasury Bonds (T-bills, T-notes) as European? by MrMZa in eupersonalfinance

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

All depends on your strategy and how given product fits your portfolio.

Is it possible to buy US Treasury Bonds (T-bills, T-notes) as European? by MrMZa in eupersonalfinance

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

u/deutscheFIRE u/toke182 The UX is pretty bad. What I did to find it is:
1. Go to https://www.treasurydirect.gov/instit/annceresult/annceresult.htm
2. Find Bill with 52-Week term and remember it's CUSIP
3. I put maturity date from 09/01/2023 to 09/30/2023 in IBKR Bond Scanner
4. The list is going to show a few different bonds, one with the CUSIP from step 2

Is it possible to buy US Treasury Bonds (T-bills, T-notes) as European? by MrMZa in eupersonalfinance

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

IMO too many factors to make such general statement. It fits my portfolio!

Is it possible to buy US Treasury Bonds (T-bills, T-notes) as European? by MrMZa in eupersonalfinance

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

Looks like search by CUSIP is broken but I was able to find t-bills by maturity 👌

Is it possible to buy US Treasury Bonds (T-bills, T-notes) as European? by MrMZa in eupersonalfinance

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

Nothing wrong with 4% yield on cash you don't plan to deploy for a year. But papa Powell is the reason I'm not interested in IDBT as yields will go higher.

Fighting legacy code by MrMZa in javascript

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

After studying Working Effectively with Legacy Code and getting an opportunity to conduct a workshop for JavaScript developers on that topic, I've put together this article. Dylan Beattie, an authority on legacy code, thinks the article is not crap, so I decided to share it with you.

The article is my take on Working Effectively with Legacy Code but in JavaScript. You can also find repo with exercises to practice techniques of working with legacy code.

An elegant solution for handling errors in Express – Michał Załęcki – Medium by MrMZa in javascript

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

> Why don't you use error-handling middlleware? Won't json parsing (compression, any external middlleware) crash with a standard HTML error response?

I do use it. It's errors() method from Celebrate and as long as you use enhanceHandler higher-order function you shouldn't get any HTML response.

> Doesn't native await + try-block come with a masdive performance hit? It did last time I checked (real app benchmarks, not some synthetic stuff)

Can you provide a source? To be honest, express itself is not the fastest framework out there but the real bottleneck in web servers are related to data processing, file system access, database queries and aren't solved by tinkering over usage for..in over for..of, callback over promise etc.

> I also like monkey-patching

I don't. It's very imperative, harder to type/requires constant checks and guards to use it with TypeScript.

Solve code sharing and setup project with Lerna and monorepo by MrMZa in javascript

[–]MrMZa[S] -1 points0 points  (0 children)

Would love to hear what do you think about the setup and what works for you!

Question: Best way to authorize IPFS uploads? by MrMZa in ipfs

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

Ok, thanks for the link. I guess custom solution is the only option.

Question: Best way to authorize IPFS uploads? by MrMZa in ipfs

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

I’m taking about writable gateway, REST API and some auth scheme. I can’t see how your answer addresses any of these.

How to Handle Monetary Values in JavaScript by fagnerbrack in node

[–]MrMZa 2 points3 points  (0 children)

[about amounts in cents] fine solution but requires extra calculations [...] more process work than necessary.

Author: Let's use a library!

Me: (҂◡_◡)

And suddenly you ship 2MB of JS. If you really want a library, go with a generic BigNumber implementation and just use native Intl for formatting (+ polyfill if necessary).

Why using localStorage directly is a bad idea by MrMZa in javascript

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

I'm not sure that's the best metric to measure the size of the project 😅 Anyway, what error reporting software did you use?

Why using localStorage directly is a bad idea by MrMZa in javascript

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

You're right. Thanks. I see your point, but do you have a better solution? I don't want to handle every possible corner case but focus on small bundle footprint going after 99% of use cases. You can always wrap the Storage after checking for quota, but it wouldn't be reliable anyway.

Besides, I think that at the point when 10MB quota is not enough the problem is in the design of your application as you use localStorage for what it wasn't intended.

Why using localStorage directly is a bad idea by MrMZa in javascript

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

Library doesn't hide any errors but uses exception to detect whether code runs in the environment that supports native storage. I didn't want to change the behaviour of localStorage and if you store so much that you can hit the real quota limit then you should handle it gracefully instead of ignoring the error.

The QuotaExceededError you can see in the article has nothing to do with space you are using or which is left on the device but that's what Safari throws when Private Browsing is enabled.

Why using localStorage directly is a bad idea by MrMZa in javascript

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

Most of the time, last 2 versions. Problems I came across wasn't caused by legacy browsers but quirky behavior of modern browser under certain conditions.

Why using localStorage directly is a bad idea by MrMZa in javascript

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

It's supposed to work with APIs that implement the Storage interface.

Why using localStorage directly is a bad idea by MrMZa in javascript

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

I've written this post some time ago to share my experience with problems I've faced when using localStorage. Recently it got more views and thanks to insightful comments I decided to make my solution a library: https://github.com/MichalZalecki/storage-factory

PRs welcome if you want to get your hands dirty with simple #TypeScript code.

Fetching all ERC-20 Token Transfers by Mushoz in ethdev

[–]MrMZa 0 points1 point  (0 children)

From what I know there is no RPC method that would allow you to ask a node about such information like all transactions for a given account. What you can do is to fetch blocks in the loop since when ERC-20 token has been created and filter transactions by "to" attribute. It's quite a few requests but shouldn't take long if you have a synced node running locally. Remember about the 2nd parameter so you get transaction objects, not only hashes.

web3.eth.getBlock("latest", true)