People who continue to use Google products despite being aware of the massive privacy violations despite many alternatives being available even if you really insist on browsing email and creating documents inside a web browser for some God-forsaken reason:


*Way* too many "Seeking Freelancer" posts in the current HN freelancer thread are asking for React experience.

Maybe I should just swallow my pride and learn it already, even though I have never *not* despised these ridiculously massive front-end frameworks that turn things that should be simple web pages into slow, heavy "web applications." (You know, like Mastodon.)

AngelList and Craigslist:

- Both end with "list"
- Both occasionally have decent freelance opportunities (looking for some more work, btw)
- Both have peaceful favicons

Is there a market for people with knowledge on how to prepare epubs for Apple Books and Google Play? It's something I've become competent at in the last couple years. Do independent authors hire out to people to do that sort of thing for them?

No, the correct answer was to do it with the DOMDocument.

Turns out there's a really easy XPath to get all text nodes in a DOMDocument: `//text()`

…and append another text node with the rest of the text with the original node… unless the text in *that* node has a profanity hit…

Yeah, after rubber-ducking it, I think I'll do it before the Markdown parsing. Not correct, but the client was hoping to launch this part of the project this week…

I'll be using stemming when checking for profanity, by the way, so that if "poop" is in the list, "poopy," "poops" and "pooping" will all be hits. Trying `wamania/php-stemmer` for now. Open to others.

I guess doing it after the Markdown parser has run and you have something similar to a DOMDocument before it gets serialized to HTML (we're using `league/commonmark`). But that code is weird and I don't like using it.

I guess doing it before the Markdown parsing would be simplest. But doing it with the DOMDocument seems the most correct; find all the text nodes and look in those. But if there's a hit, I have to truncate the text in the original node, append the "profanity removed" node, create…

Today I am implementing a profanity filter on a "comment" field (certain bad words get replaced with `<em>profanity removed</em>`) which takes Markdown input and saves the processed HTML (and the original Markdown) in the database. The pipeline to do this takes the HTML, loads it into a DOMDocument, does some more mangling on it (for example, removing external links), then reserializes the HTML before it hits the database.

At what point would you do the filtering?

I think a site's web design has definitely gotten too "heavy" when it reimplements frickin' scrollbars.

You know, like Mastodon does.

I hope that some day I create a product which is so successful that it gets several sequels and one of them is "Name of Product: Revelations."

Of course, as I'm rubber-ducking this, I'm remembering that the Unix-timestamp-in-INTEGER approach actually *does* "store the time zone" since that will always be in UTC. Hmm.

Show thread

Recently I've been leaning towards TIMESTAMP with query functions to convert back to UTC. I almost never need to insert a real date into my data and instead use `DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP` for most fields anyway. And maybe the query optimizer is smart enough to just keep the date in UTC rather than converting back and forth. Who knows how those things work. And none of my current code will still be used in 2038… right? That would be silly.

Show thread

Friendly reminder that, in the Year of Our Lord 2021, our options for storing dates in MySQL are:

- Unix timestamp in an integer field. Not human readable; no sub-second precision (if needed); no time zone.
- DATE/DATETIME. No time zone.
- TIMESTAMP. Dates converted from "local time" (whatever that is) upon storage and converted back upon retrieval unless using functions in your query to convert it to something else. Y2K38 issues (only 17 years away…)

Which crappy option is best?

20 years ago on the web, you had to jump through tons of hoops to listen to anything resembling recorded music, but you could read some article written by someone instantly, for free. i think it's becoming the other way round now

"Install on it!" Okay, and then what? I already know I'm capable of installing OpenBSD on things so it's not like it'd be much of a learning experience or anything just to do that.

Show thread

Found my old Raspberry Pi 1 the other day. I *think* it's a Model B… trying to figure out what to do with it. I recall having the same problem when I originally got it. Any ideas?

Incidentally I originally bought it used with Dogecoin, back when Dogecoin was worth a whole lot less than it is now. So by some standards it's quite possibly the most expensive Raspberry Pi in history.

Lies, you need at least 20MB of JavaScript to make any functional web page, everybody knows that

Oof, going back to 1080p screens after using exclusively my "Retina" laptop for a week is proving difficult. Can anyone recommend an affordable high-DPI monitor which is preferably less than 28 inches or so? Does such a thing exist yet?

Show older
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.