HNHacker News
TopNewBestAskShowJobs

mpetrovich

254 karma · joined May 29, 2016

petro.blog
submissionscomments
mpetrovich··on Show HN: Hacker Times, a New York Times-inspired version of Hacker News
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...

mpetrovich··on Fuck it, make it anyway
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.
mpetrovich··on Doctors are finally learning to manage antidepressant withdrawal
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.

mpetrovich··on Half-Baked Product
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.

mpetrovich··on The Website Specification
I suspect they ask for email first in order to determine whether to log you in via SSO vs. require a password.
mpetrovich··on PHP's Oddities
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

mpetrovich··on OpenAI Adopts Google's SynthID Watermark for AI Images with Verification Tool
Seems inferior to C2PA, which is actually an open standard: https://contentauthenticity.org/
mpetrovich··on GitHub is investigating unauthorized access to their internal repositories
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)
mpetrovich··on You need to calm down
AI isn't changing the fundamentals of building software. It's changing the speed. Don't confuse the two.
mpetrovich··on Show HN: Turn any workflow diagram into compilable, running and stateful code
Some feedback: show example input & output without requiring me to create an account.

Looks interesting, best of luck!

mpetrovich··on Show HN: An API that takes a URL and returns a file with browser screenshots
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.

mpetrovich··on Show HN: AI Generated (Not-Real) User Avatar Images for Development Needs
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 :)

mpetrovich··on Show HN: AI Generated (Not-Real) User Avatar Images for Development Needs
Perhaps something powered by thispersondoesnotexist.com would better for that. That site returns completely AI-generated faces that seem much more realistic and candid.
mpetrovich··on ChatGPT is now a brilliant tool for winding up telemarketers and scammers
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”

mpetrovich··on Is ORM still an anti-pattern?
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?

mpetrovich··on The Messy Page Or: why I don't like greenfield projects
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.

mpetrovich··on U-Bahn station in Berlin is decorated with radioactive uranium glazed tiles
No, he’s talking about the movie. You know, the one with the sub.
mpetrovich··on Enabling the Future of GitHub's REST API with API Versioning
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.

mpetrovich··on Enabling the Future of GitHub's REST API with API Versioning
You’re saying that it’s LESS likely to specify the API path at the callsite than the HTTP header? o_O
mpetrovich··on Enabling the Future of GitHub's REST API with API Versioning
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.

mpetrovich··on Enabling the Future of GitHub's REST API with API Versioning
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...

mpetrovich··on Intentionally making close friends
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.

mpetrovich··on Show HN: I made a sliding puzzle game
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?

mpetrovich··on Show HN: I made a pretty relaxing puzzle game
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/
mpetrovich··on Apple Interview – 1995
Anyone else remember playing Glider? As a young kid, I gladly lost countless hours trying to navigate a paper airplane through a Rube Goldberg mess of obstacles. What a fun, imaginative game.

Would be cool if there was an emulated version somewhere. Or we could borrow the author’s book and transcribe it to a modern language, ha.

mpetrovich··on Implementing strict three-point perspective
Back in college I wrote a 3D rendering engine using what seems to be a similar method as the OP. I always thought the results looked a little strange... https://github.com/mpetrovich/CUB3D
mpetrovich··on Ask HN: Who is hiring? (June 2021)
Pandora + SiriusXM | Product Manager | Remote | Full Time

Product Manager, Data Platform & Enablement

Want to be a product manager on a team that helps the largest audio entertainment company in North America understand and act on its listenership?

Apply here: https://jobs.jobvite.com/careers/siriusxm/job/oU6KffwJ

100% remote friendly. NO formal product management experience required. Folks with non-traditional backgrounds should apply!

mpetrovich··on New in PHP 8
You might also be interested in Dash: https://github.com/mpetrovich/dash
mpetrovich··on Google – polling like it's the 90s
The author makes an unvalidated assumption that the users of this service care MOST about bandwidth efficiency.

I suspect that users care more about a service that works reliably. An extra 50-100k every 5 minutes (assuming the user keeps their mobile browser open during this time) does not seem like it would be problematic.

Ironically, the alternatives he proposes make the service LESS reliable, since many users may be behind firewalls that block WebSockets, HTTP streaming, etc.

HTTP polling works for a larger percentage of users and can be scaled horizontally more easily than these other methods during high-volume spikes like the World Cup.

In short, I think Google made the right tradeoff between dumb, boring, accessible vs. clever, complex. Especially for a product that probably doesn’t meet the threshold for investing in a more sophisticated architecture.

mpetrovich··on Ask HN: How do you keep track of articles you want to read?
I add articles to Instapaper using the Chrome and iOS extensions. Then in Instapaper I highlight key phrases/takeaways which get automatically added (via IFTTT) to a new Evernote note for each article. I periodically review these notes to reinforce the takeaways (ie. spaced repetition).
Page 1 of 3Next →