Better HN
topnewbestaskshowjobs
Log inSign up

mpetrovich

253 karma · joined May 29, 2016 (10y ago) · 75 submissions

petro.blog
Submissions

comment 5d ago · link · parent

You have a problem.

“I know, I’ll use regular expressions to solve it,” you think.

Now you have two problems.

comment 3w ago · link · parent

Here's a JS bookmarklet I use to apply dark mode to any website. It tries to preserve colors and avoids inverting graphics. Add a new bookmark to your toolbar and paste in that JS in place of the link. I hope you find it useful!

https://gist.github.com/mpetrovich/b3e4ec291d21bbdbe17b1adf4...

comment 2mo ago · link · parent

You took the words right out of my mouth. Writing code used to force you to understand it, but now the former doesn’t guarantee the latter. And most attempts to replicate the latter in other ways (more reviews, self-quizzes, etc) seem to be far less effective at producing deep understanding.

comment 2mo ago · link · parent

You can also taper off by reducing dosage one day of the week at a time. Thats how I tapered off a 10mg Escitalopram prescription: every 4 weeks, I added another day of the week where I reduced my dosage by 5mg. Took about a year to fully taper off and had to pause for a month here and there to stabilize, but it was worth it.

However, it was equally important that I had a support structure & tools to replace what the SSRI was doing. For me that was mindfulness and therapy.

comment 4mo ago · link · parent

The classic solution-in-search-of-a-problem.

If the founder had started by talking with people in the problem space, he could have discovered what problems were actually worth solving before investing any money and effort into a product.

Everything after that happened were downstream effects of creating something without a defensible reason why and for whom.

comment 5mo ago · link · parent

I suspect they ask for email first in order to determine whether to log you in via SSO vs. require a password.

comment 6mo ago · link · parent

I found php’s array methods lacking as well. The inconsistencies are a pain. I ended up porting many of the methods from lodash, underscore, etc. to php: https://github.com/mpetrovich/dash

Maybe you’ll find it helpful

comment 6mo ago · link · parent

Seems inferior to C2PA, which is actually an open standard: https://contentauthenticity.org/

comment 6mo ago · link · parent

If that’s true and they do intend on shredding their copy on sale, what stops GitHub from buying it back themselves? (through a proxy, obv)

comment 6mo ago · link · parent

AI isn't changing the fundamentals of building software. It's changing the speed. Don't confuse the two.

11.

You need to calm down(petro.blog ↗)

1 points · by mpetrovich · 6mo ago · 1 comment

comment 1y ago · link · parent

Some feedback: show example input & output without requiring me to create an account.

Looks interesting, best of luck!

comment 1y ago · link · parent

Reminds me of this open source library I wrote to do the same thing: https://github.com/nextbigsoundinc/imagely

It uses puppeteer and chrome headless behind the scenes.

comment 2y ago · link · parent

Good point. What if we combined the best of both: more realistic images from tpdne.com and API-accessible metadata from your site?

Seems like a matter of crawling the former to get all the images and then tagging them and serving them via your API.

Anyway, I think your approach is great and only wanted to propose a possible approach to the original feedback above :)

comment 2y ago · link · parent

Perhaps something powered by thispersondoesnotexist.com would better for that. That site returns completely AI-generated faces that seem much more realistic and candid.

comment 3y ago · link · parent

The demos on the Jolly Roger site are hilarious. The bot sounds so realistic, and the bot even had the audacity to ask the scammer, “Are you a real person?!”

“Hold on, there’s a bee on my arm”

comment 3y ago · link · parent

In my career, the biggest problem with ORMs I’ve used is something the author touched on:

They can be terribly leaky abstractions. It seems that many ORMs end up re-implementing SQL in their own domain-specific language.

However, an understanding of SQL is often needed to debug and optimize ORM queries.

So why not just use SQL directly then?

comment 3y ago · link · parent

My goodness, this describes me perfectly as well. The countless choices of a blank slate brings anxiety to a recovering perfectionist like me. Do I choose A or B or Z?

I prefer improving things rather than creating them from nothing. I’ve come to a similar conclusion as the author as far as how to get out of the fog of greenfield: Satisfice instead of optimize.

In this context, optimizing refers to choosing the best among N options. In contrast, satisficing means choosing the first option that’s good enough. Often, the opportunity cost saved from satisficing is greater than the marginal value gained from optimizing.

comment 3y ago · link · parent

No, he’s talking about the movie. You know, the one with the sub.

comment 3y ago · link · parent

Oh, so you’re saying that omitting the version from the header will ALWAYS return this specific version, NOT the latest version?

That certainly addresses the footgun I mentioned.

EDIT: From the docs: Requests without the X-GitHub-Api-Version header will default to use the 2022-11-28 version.

comment 3y ago · link · parent

You’re saying that it’s LESS likely to specify the API path at the callsite than the HTTP header? o_O

comment 3y ago · link · parent

I agree with you, so then why not stick with the previous /api/v2 url approach?

And it would annoy me far more if my app that talks to GitHub inexplicably breaks in a few years because of a release I wasn’t aware of.

These changes make no sense to me.

comment 3y ago · link · parent

Making the version optional is a bad idea, IMO. It lets consumers use your API without versioning, which is like telling them, “here, create a time bomb that may or may not explode when the next breaking api change is released.”

There’s zero practical user benefit to NOT specifying the version, so why not enforce it? You’re creating a footgun otherwise.

Furthermore as others have pointed out, this is a purely cosmetic change. Using /api/$UNIQUE_STR in the URL vs. X-GitHub-Version: $UNIQUE_STR in the header are functionally equivalent, so…

Why bother making this change then? What was suboptimal about the previous way? What benefit does this bring?

EDIT: Serves me right for not reading the docs more carefully. From the docs [1]:

Requests without the X-GitHub-Api-Version header will default to use the 2022-11-28 version.

See phphphphp’s reply below for context.

[1] https://docs.github.com/en/rest/overview/api-versions?apiVer...

comment 3y ago · link · parent

The systems angle mentioned later in the article may seem a bit …engineered, but it works!

I’ve moved a ton in my life, and I have an annoying habit of losing touch with friends when I move away. Out of sight, out of mind, ya know?

Anyway, to combat this annoying habit, I started scheduling monthly phone/video calls with each of those friends. It’s been a game changer, especially as folks have kids and busy lives.

comment 3y ago · link · parent

I hadn’t considered it since it’s mobile-first, but that’s a great idea to try!

I imagine that the arrow keys would control the movement of the empty space, right?

26.

Show HN: I made a sliding puzzle game(tileslide.com ↗)

3 points · by mpetrovich · 3y ago · 3 comments

comment 4y ago · link · parent

Really fun! This inspired me to create my own version of the sliding-tile puzzle game that I used to play as a kid: https://tileslide.com/
123