HNHacker News
TopNewBestAskShowJobs

porsager

1,334 karma · joined July 11, 2013

https://github.com/porsager https://twitter.com/rporsager
submissionscomments
porsager··on How to Use JSON Path
That sounds very interesting. Could you elaborate on that?
porsager··on Parallel Snapshotting: make pg_dump and pg_restore multi-threaded per table
I was expecting to see https://github.com/dimitri/pgcopydb when clicking this. How is this different?
porsager··on Zed, a collaborative code editor, is now open source
Honestly no. Not more at least.

There are some that does exactly as I mention by mentioning things not in the code like:

```

// Non-generic part of edit, hoisted out to avoid blowing up LLVM IR.

```

Most of the others it does have are even unnecessary. Like this one.

```

/// Returns enclosing bracket ranges containing the given range or returns None if the range is not contained in a single excerpt

pub fn enclosing_bracket_ranges<'a, T: ToOffset>(

```

The description is literally in the function name.

Also this tweet touches on a similar issue - https://twitter.com/transmutrix/status/1750563200708309466

porsager··on Apple announces changes to iOS, Safari, and the App Store in the European Union
You're talking about the EU and states alike - right?
porsager··on Zed, a collaborative code editor, is now open source
Did you make an issue for that? (I'm sad about that too)
porsager··on Zed, a collaborative code editor, is now open source
What a weird statement. It's beautiful! You don't need comments, just read the code. No need to litter code with ambiguous language. The only place a comment fits is if the purpose is not clear from the code.
porsager··on Zed, a collaborative code editor, is now open source
I'm not sure that claim is correct, but could you describe what that setup looks like, and the benefits? A link to something more is also fine
porsager··on Zed, a collaborative code editor, is now open source
I think this might be an issue for the same thing:

https://github.com/zed-industries/zed/issues/4352

porsager··on Zed, a collaborative code editor, is now open source
It is such a game changer for me. Pair programming or multi pair programming if you will, suddenly has 0 barriers. Including others in your session with no overhead changes things completely. Before I would rarely include others in my processes because it cost too much. Now I'll do it whenever... Switched from sublime and got my coworkers macs just to be able to use zed and work in this way.

It is extremely important it works fast and fluid, and zed is the only one I've tried that nails it. There are still a few things that needs tweaking wrt. undo history, but I'm sure they'll get that to feel intuitive in the end.

porsager··on Clicks – Physical keyboard for iPhone
Oh - Just checked, you're right these words are reversed in the default dictionary. They'll be right there in front the first time you use them thought, and I'll look into seeing if I can find a good rule for improving the preference by default.

The dictionaries are compiled from large known corpuses, wikipedia and movie subtitles, to ensure most words are available, but it does also mean that some weird words sneak in. That shouldn't matter much since it's very quick to adjust to your usage, and due to the usage sorting the weird words should never come first.

About the punctuation you just need to scroll the symbols window to get to the rest ;)

porsager··on Clicks – Physical keyboard for iPhone
Thanks a lot! That's some good feedback. (you wrote in the app support chat too right?)

Wrt. Apple Watch, there is unfortunately no support for custom input support, so it has to be a weird hack where you type in one app and copy paste to another or such shenanigans. At least it was the last time I checked.

porsager··on Clicks – Physical keyboard for iPhone
It doesn't even need to be physical - You should definitely give Type Nine a try ( https://typenineapp.com ) - (disclaimer - I'm the author). There are some promo codes below so you can try it out:

I've used this since 2014 when I made the first version, and I have yet to meet anyone typing faster with the stock iPhone qwerty keyboard.

7AMYNPKN63KY EMMHTLRA9399 Y4TPAXMJFHLL 4F3Y4JJ3RHME YREJF6L4TYE7 KWM9LRRXJEXW Y6JJRM99NYLM KRJXYPLE666L 43Y3EANXXW9F 9H99XY3FTT7L

porsager··on Argentina elects 'shock therapy' libertarian Javier Milei as president
Well it of course depends on - if those sectors were massively propped up by goverment. That was most certainly the case for the engineers in USSR you mention, but even so - had there not been state conflict, and more open opportunities for foreign investment, how are we to say they couldn't have fared much better? We should catch up in 10 years and do a rain check on this ;)
porsager··on Argentina elects 'shock therapy' libertarian Javier Milei as president
Definitely! And yes, it will be a stark awakening for many. Many who for years have made their income, not by productive means, but by political means. The amount of people that can rise out of poverty instead will outnumber them easily, and so, the rest will adapt in the end. The 40+ year old with children were already hurting. They will hurt less.
porsager··on Argentina elects 'shock therapy' libertarian Javier Milei as president
I think the change is very much reflected from the system being changed to. Javier Milei has not been shy to say that he intends to slash millions of government jobs, but with the important note, that people will move freely before then because of better offers from the private sector. Now you can't say that about the other revolutions we've seen, because that was just a change of hands on power, not a dissolution of it. Even so, I'm ecstatic that Argentina might show this is possible. Hopefully as a great inspiration to others! There will be many fighting against it, but I'm an optimist, and I'm certian people exposed to real freedom can and will adapt.
porsager··on Argentina elects 'shock therapy' libertarian Javier Milei as president
Haven't seen any communist places go to an anarcho capitalist system, so your comparisons don't say much. The mere fact that Milei won makes me want to find out if I can move to Argentina!
porsager··on Argentina elects 'shock therapy' libertarian Javier Milei as president
Argentina will now lead the world by example! Congratulations!
porsager··on [dead]
And he's going to allow it to be exactly that.

What positions turn you off? I think the only thing I can put a finger on is his flawed view on abortion, but I guess that relates to him being a Catholic.

porsager··on Show HN: Web app to generate AI pictures with logos "hidden" in them
So the exact same as https://ailogoart.com ?
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Author here - I'm actually a happy previous pg-promise user :)

If you check out the documentation I think you should be able to see if it's worth it for you to switch. My personal top reason is the safe query writing using tagged template literals, and the simpler more concise general usage. Then there's a lot around connection handling which is simpler, but also handles more cases. Then there's the performance. Postgres.js implicitly creates prepared statements which not only makes everything faster, but it also lowers the amount of work your database has to do. Pipelining also happens by default. As you can see by the benchmarks listed elsewhere, Postgres.js is quite a bit faster, so you can either get more oomph out of your current setup, or scale down to save some money ;)

Even so, if pg-promise works for you as it is, it might not make much sense to switch, but if you have the connection slots for it, you can run them side by side to get a feel for it too.

Another thing I remember when starting with pg-promise was the return value helpers, which I used a lot. Now - I think it's much nicer to have the simple API, and simple return value being an array, like Postgres.js does[1]. Especially now that we have destructuring, it just looks like this:

    const [user] = await sql`...`
[1] There's a JS Party podcast where we talk about that as well https://changelog.com/jsparty/221
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
I can't read if you're being snarky or if you are being earnest.

If snarky, is this based on something that actually happened to you? If so, I would love to hear how that actually went about, and what it is you are unable to grasp when things aren't bogged down by complexity?

If earnest, I'm glad more people prefer code that isn't littered with premature abstractions, redundant types, and useless comments expressing what can be more clearly read in the actual code.

porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Author here. Worth noting is that Cloudflare is now also supported :)
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Thanks Pier! Your comment saved me some frustration here :-D

https://github.com/porsager/postgres/discussions/627#discuss...

porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Thanks a lot!
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
There's a link to a simple Benchmark right after the title.

Here are two:

https://github.com/porsager/postgres-benchmarks

https://porsager.github.io/imdbench/sql.html

porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
The input parameters are still dynamic which is made explicit with tagged template literals, so that makes almost all queries static in nature.
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
No but I'm using this simple forwards only little side library https://github.com/porsager/postgres-shift
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Uff. Author here. Care to share more? There's no regexp related to json handling, maybe you're thinking of the dynamic query helpers? If not could point to an issue or create one on the repo it'd be great.
porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
Most people care to some degree what other people say about them / their work.

The fact that you've also dabbled in this area could lead to a far more interesting discussion. Wouldn't mind seeing your blog post. Who knows, maybe I've already read it at some point?

btw the reason for extending eg Array is to make for a much better surface API when using the library.

Being able to do const [user] = await sql`...` leads to some very readable concise code.

porsager··on PostgresJs: PostgreSQL client for Node.js and Deno
It's all about familiarity. To me ternaries gives me less ways in which the code can behave, so it takes less time to write, and less time to read. The obvious reason is that it's an expression and not a statement. So, the reason for me not writing it like this to begin with, is because I prefer ternaries over ifs. So much that i sometimes rewrite other code from ifs to ternaries to better grasp it. But that's me.
← PreviousPage 2 of 8Next →