HNHacker News
TopNewBestAskShowJobs

Mogzol

627 karma · joined April 20, 2016

submissionscomments
Mogzol··on Day.js – Fast 2kB alternative to Moment.js with the same modern API
I wouldn't recommend anyone use moment.js if they're starting a new project. It's an unnecessarily large library, and the fact that moment objects are mutable almost always causes more issues than it solves. The only reason to use it is if you're working on software that is already using it. Otherwise use a more modern, immutable datetime library like day.js, date-fns, or luxon.
Mogzol··on Manifest V3, webRequest, and ad blockers
If that happens I suspect they would lose a large portion of their userbase to Firefox. The main selling point for a lot of people is that these browsers are basically Chrome without the Google stuff. If they change to Quantum, why would people not just use Firefox? Unlike Chrome, Firefox is already fairly privacy focused, there's not as much of an incentive for people to use alternative Firefox-based browsers.

I currently use Brave, but if they switched to using Quantum I personally would just switch to Firefox proper.

Mogzol··on Let websites framebust out of native apps
The tiktok thing is so annoying. It's not even possible to get the URL of the page you're viewing so you can open it in another app, and you can't long press any links to copy them either (neither in the in-app browser or in a user's bio). It makes it so frustrating when someone has social media links in their bio, because there's literally no way to open them in a different app short of manually typing out the URL. I understand why they do it (data collection/tracking), but it's a horrible user experience.
Mogzol··on They're made out of meat (1991)
The short film by Stephen O'Regan based on this is pretty good if you haven't seen it: https://youtu.be/T6JFTmQCFHg
Mogzol··on I want an iPhone Mini-sized Android phone
I've been very happy with mine. As another user mentioned, the main issue with it is the battery life isn't as good as some other Android phones, but it's good enough that as long as I charge it daily I rarely have to worry about it. Though I do really wish it had wireless charging.
Mogzol··on PSA: React 18 calls code twice in strict dev mode to detect side effects
> code in a useEffect(…, []) block is being called twice

Shouldn't that be one of the few cases where the code isn't being called twice? useEffect is meant for side-effects, so it isn't included in the list of functions that React will call twice.

Mogzol··on The 0.5 MB of nothing in all Apple Music files (2020)
For chargers I believe they're referring to the fact that apple stopped including chargers with new iphones.

> Either be nasty and durable, or be less nasty and be less durable.

In my experience apple cables are both nasty and less durable than most other cables I own. I have multiple old 30 pin cables that are frayed at the connector, my old ipod headphones had electrical tape on the cable where the rubber was breaking, and all my apple cables are a gross yellow color, while similarly old non-apple cables I own are all still perfectly white.

> I think their 200G plan has good bang for the buck

It's average at best. It's the same price as google for monthly payments, but google is cheaper if you pay yearly.

Mogzol··on ReVanced
> They were taken down for using a similar enough logo to Youtube that Google lawyered them into stopping that way, not for any kind of infringement in terms of software.

Is there a source for this? Seems like they could have just changed the logo if that was the case, no?

Mogzol··on SingleFile: Save a complete web page into a single HTML file
Is this really still an issue in 2022? How many people are browsing the internet on a device that can't do hardware H264 decoding?
Mogzol··on Elevator.js (2015)
The audio is the whole point of the library. Otherwise you could just use

  window.scrollTo({ top: 0, behavior: "smooth" })
Mogzol··on Wordle is pretty damn smart in many subtle ways
I've really been enjoying Quordle. When I first saw it I thought it was just another clone with an interesting gimmick, but something about it just works so well, it's really fun to play. Going back to the original Wordle almost seems boring afterwards.
Mogzol··on Outlook just asked me if I want to upgrade to bigger ads
If you have the tabbed inbox enabled (i.e. Social, Promotions, Updates, Forums), then Gmail will insert ads into the non-primary tab that look almost like regular emails. If you have the tabs disabled so that all your messages show up in the Primary inbox, you don't get ads.
Mogzol··on Unlisted App Distribution
I don't really understand this perspective. Why should you be allowed to run whatever you want on your MacBook but not on your phone? What makes a phone so different that the software you run on it should be more restricted than the software you run on a desktop?

I would understand (though personally disagree) if you wanted the walled garden everywhere, but it seems contradictory to only want it on phones and not computers.

Mogzol··on Primel – guess a 5 digit prime number – each guess must be a prime
Yeah I would really rather this just let me guess non-primes even though that would make it more challenging. Trying to find a prime by guessing randomly over and over is pretty frustrating.
Mogzol··on OS X-KVM: Run macOS on QEMU/KVM
Sorry for the late response, just saw this. When I did it last I just used the Docker-OSX project [1]. It should pretty much just work, the readme has a section about on running it on WSL.

If you don't want to use Docker it should still be possible with the OSX-KVM, I've done it before, but I can't remember the exact steps I took to get it running, sorry.

Should also note that I've run into issues with AMD CPUs, Intel seems to work better, but I also haven't tried it since they first added nested virtualization support with AMD CPUs to Hyper-V, so those problems might be fixed now.

[1] https://github.com/sickcodes/Docker-OSX

Mogzol··on OS X-KVM: Run macOS on QEMU/KVM
Im running this on Windows though WSL 2. There's definitely a performance hit but other than that it works surprisingly well.
Mogzol··on You can't download this image
Did you even try this before posting? These steps are no different than just right-clicking the image and choosing "Save image as". It still results in a download that never finishes.
Mogzol··on Ask HN: Why there are no Android mini phones?
I recently bought a ZenFone 8 specifically for its size, it's slightly shorter than the Xperia 10 III, and the same width. Very easy to use with one hand. I really like it, it has a headphone jack, decent enough cameras, a 120hz screen, and a snapdragon 888, so it's basically as powerful as any other current android flagship, just smaller.
Mogzol··on Why I Hate Frameworks (2005)
One of the main selling points of Prettier for a lot of people is that it is extremely opinionated and leaves very little formatting choices up to the user. If you respect user-introduced whitespace then the same code written by two different people can end up formatted differently, which is precisely the problem Prettier is trying to to solve.

I would argue the example posted above is still "consistent" because the rules Prettier follows for line breaks (and everything else) are consistent throughout the codebase. Things will be on one line until the line is too long or complex, and then it will break to multiple lines. The rules don't change depending on who was writing the code, what the code is, or any other factors. It may not be formatted exactly how you want, but that's kind of the whole point. It's formatted how Prettier wants, and that's the only option.

Mogzol··on Why I Hate Frameworks (2005)
I actually really like Prettier. It ensures that everyone's code ends up formatted the same, and when you're working on a project that a bunch of different people touch, that makes reading the code so much easier. It may not always be beautiful, but at least it's consistent and readable.

It also means I have to spend zero time worrying about formatting. Now I often just type stuff out on one ugly line, then hit ctrl+s and everything magically formats itself, it's honestly great. Whenever I work on code without Prettier it makes me realize how much time I spend just formatting things.

Mogzol··on Part of Windows 11 is a revamped Windows Subsystem for Linux
The new notepad version was released to non-insiders in Windows 10 1809, so it's still been around for almost 3 years now. I do understand that git wants to maintain the best compatibility, but at this point I would argue that converting to CRLF on checkout is causing more issues than it solves.
Mogzol··on Part of Windows 11 is a revamped Windows Subsystem for Linux
I think one of the main problems is that when you install git for windows, the default setting is to convert LF to CRLF when checking out code. This can cause a bunch of issues if you later try to work with those files within WSL (especially when doing any git-related stuff). I don't really understand why that's the default, or even why it's presented as an option during installation, it's been ages since I actually had issues reading/editing Unix-style files in Windows.
Mogzol··on Part of Windows 11 is a revamped Windows Subsystem for Linux
One issue that I've run into is that if you only bind to IPv6 in WSL, then you will only be able to access the service using IPv6 on the Windows side (i.e. ::1 works, but 127.0.0.1 doesn't). OSs usually automatically bind to IPv4 whenever you bind to IPv6, but that's not the case with WSL (actually, it does bind to both, but only inside WSL, not on the Windows end). Lots of programs (like node) bind to IPv6 by default, so this can catch people off guard and they wonder why 127.0.0.1 or localhost isn't working.

Here's the github issue about it: https://github.com/microsoft/WSL/issues/4851

Mogzol··on Gmail password first character is case insensitive on mobile device
Hashing on the client still seems redundant though. In the end, whatever value is sent to the server is essentially plaintext, because it's all an attacker needs to know to authenticate. Whether it's the raw text the user typed or some transformed version of it isn't really relevant.
Mogzol··on Windows 11: Just say no
A lot of the features were already part of the insiders version of Windows 10 before 11 was announced. Seeing as its a free upgrade, I think of it as just another one of the semi-yearly Windows 10 upgrades (i.e. Windows 10 21H2), rather than a whole new OS. Upgrade for the same reasons you kept Windows 10 up to date.
Mogzol··on iOS on QEMU
Newer versions of VMWare work under a Hyper-V host [1]. I'm not sure if macOS runs properly in that mode though. I also had some success a while back running macOS under WSL2 using KVM [2], though it was pretty buggy and a pain to set up.

[1] https://blogs.vmware.com/workstation/2020/05/vmware-workstat...

[2] https://github.com/kholia/OSX-KVM

Mogzol··on GM tells some Bolt owners to park 50 feet away from other cars
With phones and regular usage you are likely doing full charge/discharge cycles every day or two, which is hard on the battery. That's not really the case with electric cars. When you have 200-300 miles of range, and you only regularly drive, say, 20 or 30 miles per day, it's pretty easy to keep the battery around 70%-80%, which should significantly extend the life span.

Obviously the batteries still degrade, but they should be usable long past 3 years assuming regular driving habits.

Mogzol··on PyWhat: Identify Anything
I find it kind of funny that they would choose to show those as demos when it's obvious that most of them really aren't Youtube video IDs. Like "Accept-Lang" is pretty obviously not actually a video ID, even if it matches the [A-Za-z0-9_-]{11} pattern and technically could be a valid ID.

On the other hand, I don't know how you would actually verify whether an 11-character string is or isn't a Youtube ID (short of querying Youtube itself), so I suppose it's nice that potential IDs are shown, just seems they have a very high chance of being false positives.

Mogzol··on Modern Javascript: Everything you missed over the last 10 years (2020)
I read it more as talking about a revolution within React. Hooks and context are (relatively) new features that do "revolutionize" how you write components. That's not to say VDOM isn't important, it just isn't anything new, it's been a part of React since the beginning.
Mogzol··on Node.js 16 Available Now
That's interesting. util.promisify normally only works with functions where the callback is the final argument, which isn't the case with setTimeout. I didn't know you could customize promisify behaviour, but looking at the docs apparently you can just by setting a property on the object using the util.promisify.custom symbol [1]. That is what setTimeout is doing, which is why that code works.

[1] https://nodejs.org/dist/latest-v16.x/docs/api/util.html#util...

← PreviousPage 5 of 6Next →