Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Klathmon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
32 ms
·
181.
▲
by
Klathmon
7y ago
I've recently gone off the deep end with QMK customization. I found a project [1] which allows you to send data from a host program to the keyboard controller. In [1]'s case it's used to power a secondary display on the keybo
182.
▲
by
Klathmon
7y ago
And to add on to the other commenter, there's also a `useLayoutEffect` hook which fires synchronously after a react render but before the browser paints the render. Basically `useLayoutEffect` fires in the same phase as `componentDidUp
183.
▲
by
Klathmon
7y ago
They point out that the get* functions are supposed to be "computationally expensive", and you don't want something like that in your render method. But also in either the current or near future versions of react, with Suspen
184.
▲
by
Klathmon
7y ago
Thanks, I fixed the typo.
185.
▲
by
Klathmon
7y ago
>The little bit of magic that makes your code sane is the "await" in front of "Promise.all()" and makes it more elegant than the callback version. I'd actually say that it's the `Promise.all` that makes it s
186.
▲
by
Klathmon
7y ago
well IMO that is much more difficult to read for me. Promises are nice because they have a single purpose, to resolve or reject a promised value. So when I see them, I can pretty much instantly understand what it's doing. `Promise.all`
187.
▲
by
Klathmon
7y ago
I actually love slinging promises like that, but I tend to avoid it in most cases as there are MANY devs that would be somewhat rightfully frustrated at the code I just wrote. As always, who you are working with matters a LOT, and if I were
188.
▲
by
Klathmon
7y ago
But those 2 examples aren't doing the same thing. My Promise.all example will fire off the getFoos, getBars, and getBazs requests all at the same time, and then do things at different moments with the results in some cases. Yours will
189.
▲
by
Klathmon
7y ago
>Your "legible" example is only legible because you are not doing anything actually important like error handling and logging. async function doStuff() { try { // Fetch things concurrently
190.
▲
by
Klathmon
7y ago
you can chain them and avoid the nesting. Anything a .then handler returns becomes the value of the next one like this: fetch(url) .then((response) => response.json()) .then((json) => { // do stuff
191.
▲
by
Klathmon
7y ago
This can be a good first place to look, but don't rely on it. Many integrations have their local access via reverse engineered APIs, and they often go away when they get popular enough. I wrote the Samsung Family Hub smart fridge integ
192.
▲
by
Klathmon
7y ago
I'm normally not one for "conspiracy theories", but I can't shake this idea that there might be some really clever marketing happening here. Tesla releases a "clearly one-sided" marketing video, and waits for t
193.
▲
by
Klathmon
7y ago
To be fair, people have been saying "not possible in our lifetime" to a lot of things that SpaceX has done or is doing. While I'm not convinced it will happen in the timeframes they are shooting for, I'm also not convi
194.
▲
by
Klathmon
7y ago
I wouldn't be so sure. While you obviously don't want to test it, there are videos of Model 3's and Model S's being driven through water over the windshield and were fine. IIRC there's a video somewhere of one of th
195.
▲
by
Klathmon
7y ago
I meant it as in no government contracts are going toward starship development, but looking it up it seems I'm actually wrong, maybe... The air force has given them some money for development on their Raptor engine, and they've ta
196.
▲
by
Klathmon
7y ago
They aren't using any tax dollars for Starship. It's entirely funded by their profits (at least as far as I know). And this Starship MK1 is/was a prototype designed to test some aspects of their design in the real world. It w
197.
▲
by
Klathmon
7y ago
I have a feeling that they could blow up another dozen of these and still be spending less than doing it the "traditional" way of in cleanrooms and the VFAB building. This was a prototype that they've publicly said was most l
198.
▲
by
Klathmon
7y ago
I was messing with some DIY generator wiring when I was younger and ended up getting a bite from 110. My hand was in a shitty position kind of around a table leg, and the shock caused me to clamp down with my hand and kind of "chokehol
199.
▲
by
Klathmon
7y ago
the ones at a place I worked used reclaimed water. I don't know how well filtered or treated it was, but I know that it would leave horrible water spots all over anyone who parked too close to them.
200.
▲
by
Klathmon
7y ago
If they're anything like the misting irrigation systems, they never clog even if they are literally covered in dirt and mud for most of their life.
201.
▲
by
Klathmon
7y ago
It's not about the water usage on it's own, but more about the energy usage required to heat, treat, and transport the water. According to the article "Hot water production accounts for the second most significant use of ener
202.
▲
by
Klathmon
7y ago
The article does put some numbers to the energy needed to heat the water. They estimate it at being equal to driving 3.5 – 7 km with a relatively fuel efficient car per shower. They also say they didn't count the energy costs from wate
203.
▲
by
Klathmon
7y ago
I have a feeling we will see a similar (but much slower) cycle with online video as we do with online image hosting. Every few years a new image host pops up since the incumbents are getting so terrible, they promise the world and get popul
204.
▲
by
Klathmon
7y ago
I was just sharing information that I found interesting which kind of contradicted your claim that fueling was a common source of issues for SpaceX. I find this stuff super interesting, and I figured others might as well. I'm not tryin
205.
▲
by
Klathmon
7y ago
It's not being pedantic if you are correcting the conclusion. You mentioned that fueling system issues have been a recurring theme in failures, and I just wanted to point out that it's not really correct. Even though the 2 failure
206.
▲
by
Klathmon
7y ago
Both failures may have had something to do with "fuel", but they aren't in any way related. The Crew Dragon abort test anomaly was caused by a problematic valve leaking oxidizer "backwards" into the helium tubes whi
207.
▲
by
Klathmon
7y ago
Ah good catch, I was spacing on the easiest way to show how to easiest show the operator and forgot to invoke my functions!
208.
▲
by
Klathmon
7y ago
This is a moment where the postfix `!` operator comes in handy. It is a well hidden secret, and one that I'm not going to try to lookup the docs for on mobile, but the idea is that the operator strips null/undefined from the type
209.
▲
by
Klathmon
7y ago
It'll get easier over time, just like most cars. I think once EVs become more generally popular we will see more little modding companies pop up like they do for most ICE "performance-ey" cars, but even now there are a good a
210.
▲
by
Klathmon
7y ago
I'm assuming since even 250kw EV chargers require liquid cooling and are already difficult to work with (limited length, extremely stiff and a lot of hardware to safely connect), that it becomes a bit cumbersome to work with 8 of those
More ›