Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ksbrooksjr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
ksbrooksjr
3y ago
SEEKING WORK | United States | Remote I'm a full stack web developer who's been developing web applications for almost 7 years. I currently maintain a Chrome Extension that I built in 2017 with over 6,000 users. I have extensive e
32.
▲
by
ksbrooksjr
3y ago
Yeah this code definitely wasn't designed to win any performance contests. I was mostly optimizing for readability. The easier it is to understand code, the easier it is to audit it from a security perspective. The author of that blog
33.
▲
Generating Secure Random Numbers in TypeScript
(ksbrooksjr.com)
2 points
by
ksbrooksjr
3y ago
|
2 comments
34.
▲
Show HN: Tab manager, RSS feeds, and read it later app (with rich text editing)
(freezetab.com)
2 points
by
ksbrooksjr
3y ago
|
0 comments
35.
▲
by
ksbrooksjr
4y ago
Erlang is definitely more fault tolerant than most languages, but I've found that static typing tends to catch a lot of errors in development that would otherwise crash an application in production. The compiler won't catch every
36.
▲
by
ksbrooksjr
4y ago
I wasn't trying to imply that concurrency is the only way to mitigate ReDos attacks, I was just pointing out that the BEAM applies preemption seemingly everywhere, which I found interesting.
37.
▲
by
ksbrooksjr
4y ago
There are definitely trade offs when switching from Elixir or Erlang to Go. If you're a functional programmer who can't live without immutability, or you plan on running a cluster of machines that can communicate with each other a
38.
▲
by
ksbrooksjr
4y ago
Yeah with preemptive scheduling, static typing, and better cpu utilization Go is a pretty compelling option for Erlang and Elixir users.
39.
▲
by
ksbrooksjr
4y ago
I'm not a Go expert but preemptive scheduling of goroutines is supposed to be one of the primary benefits of Go as a language [1]. Although I'm not sure if there's any runtime that adopts preemptive scheduling as fervently as
40.
▲
by
ksbrooksjr
4y ago
Javascript random number generators don't let you choose an arbitrary range. So if you have an alphabet of 26 characters (0-25) you would have to generate a random number by running: crypto.getRandomValues(new Uint8Array(1))[0] % 3
41.
▲
by
ksbrooksjr
4y ago
It looks like the plaintext is being padded so that its length is a multiple of the block size [1]. I can't find any resources that say you need to pad a message before encrypting it with AES-GCM though. The official examples from MDN
42.
▲
by
ksbrooksjr
4y ago
I really enjoyed listening to this podcast, and I'm honestly surprised at how low the per episode engagement is. There's no shortage of podcasts focusing on the economic aspect of running a business, or the technical aspect of bui
43.
▲
by
ksbrooksjr
4y ago
Apparently some users have attached smaller wheels to the front of the Onewheel that engage during a nosedive [1]. I wonder how effective these are at preventing injury. [1] https://old.reddit.com/r/onewheel/commen
44.
▲
by
ksbrooksjr
4y ago
Preact would solve most (if not all) of the performance problems listed in the executive summary of the post (build time, time to interactive, memory usage, and maximum data set size). It doesn't seem like a terrible comparison to ment
45.
▲
by
ksbrooksjr
4y ago
Well yeah obviously you can bypass the client code and directly connect to a server. That's not my point. Client side validation doesn't prevent a malicious user from sending invalid requests, but it can prevent legitimate users f
46.
▲
by
ksbrooksjr
4y ago
I read it as a straw man argument, but that might not have been the author's intention at all. It's hard to judge tone through text alone.
47.
▲
by
ksbrooksjr
4y ago
If I were using htmx I would still want to validate data on the client and the server. If you don't validate data on the client, then you're effectively allowing clients to DDOS your server with invalid data.
48.
▲
by
ksbrooksjr
4y ago
You haven't disagreed with anything I said. My original comment says "Htmx is great for developers who need client side interactivity, but would rather not write any js". I'm sure a team of Python developers is enjoying
49.
▲
by
ksbrooksjr
4y ago
Svelte is another great option with a much smaller footprint than React. If you don't feel like setting up SSR by hand, you can also just use Next.js which works fine with Preact [1]. [1] https://github.com/vercel/
50.
▲
by
ksbrooksjr
4y ago
According to the article we're commenting on, the programming model is not the sole reason for switching from React to Htmx. Look at the executive summary's bullet points. Four of them are related to performance (build time, time
51.
▲
by
ksbrooksjr
4y ago
Yea htmx definitely has a different programming model than an SPA style framework like React/Preact. I actually like the JSON api programming model where the backend is as simple as possible, and the frontend js/ts code is complet
52.
▲
by
ksbrooksjr
4y ago
Htmx is great for developers who need client side interactivity, but would rather not write any js. If you don't mind writing a bit of js however, you can't go wrong with Preact. Same api as React, but at a fraction of react-dom&#
53.
▲
by
ksbrooksjr
4y ago
One feature that's kind of difficult to emulate without Javascript is the ability to play media continuously while navigating with the back and forward buttons. Rich Harris talked about this at the 5 minute mark of his video on whether
54.
▲
by
ksbrooksjr
4y ago
I read it, and I empathize with their stance. I'm actually torn between wanting Typescript to be as compatible with Javascript as possible, and wishing we didn't have to wait for TC39's process to play out before using new fe
55.
▲
by
ksbrooksjr
4y ago
I agree that the typescript team should consider using the compiler to extend javascript rather than just supplement it with types. Like you said, there are technically parts of typescript that don't have a direct corollary in js (enum
56.
▲
by
ksbrooksjr
4y ago
It can (depending on which features you're using), but the comment that started this thread claimed that the produced code was much slower than handwritten js. I was just pointing out that the examples you gave (enums and namespaces),
57.
▲
by
ksbrooksjr
4y ago
Const enums get completely erased by the compiler, and modules are a native js feature. Non-const enums and namespaces are probably the only aspects of typescript that actually have any significance at runtime, but they get compiled into si
58.
▲
by
ksbrooksjr
4y ago
Great write-up. Note that the author is only serving 70 requests per second at peak with 15 thousand registered users and 3 thousand in revenue per month. This just shows that you don't always have to plan to scale to thousands (or mil
59.
▲
by
ksbrooksjr
4y ago
That's understandable. Not every service needs a perfect uptime record.
60.
▲
by
ksbrooksjr
4y ago
Even changing the kernel can often be done without rebooting the system depending on which distro you're using. Quite a few distros now include some sort of kernel livepatching service including Ubuntu, Amazon Linux, and RHEL.
More ›