@Crell@phpc.social avatar

Crell

@Crell@phpc.social

Anything worth doing is worth doing well.

Anything worth doing well is worth teaching others to do well.

Author of Thinking Functionally in PHP, now on LeanPub: https://leanpub.com/thinking-functionally-in-php

#tootfinder

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Crell, to til
@Crell@phpc.social avatar

: @leanpub now lets you add a Mastodon account to your author profile. Neat! I've done so, and removed my Twitter account.

(While you're over there, buy my book. :-) )

https://leanpub.com/thinking-functionally-in-php

ZachWeinersmith, to random
@ZachWeinersmith@mastodon.social avatar

Weird question:

Why do you think so few artists attempt to create a magnum opus? It really seems most people who are good at something want to just keep making it in various forms, but don't try to make a single lasting great work, even when they're in a position to try.

As an example of what I mean, take Virgil who became well known for pastoral writing, but always had an eye on writing a national epic. A few people still read Georgics and Eclogues, but the Aeneid is the Opus.

Crell,
@Crell@phpc.social avatar

@ZachWeinersmith High-risk/high-reward. Your odds of producing an opus are about 1/100000. Your odds of producing lots of decent work that puts food on the table is 1/10.

menelion, to php
@menelion@dragonscave.space avatar

Dear community! Could someone with power please raise an RFC to make the strict parameter of the in_array() built-in function true by default? It's really annoying to remember putting true as the third parameter every time, and not doing it might potentially lead to weird bugs. Thanks!

Crell,
@Crell@phpc.social avatar

@menelion That would unfortunately be a rather major BC break.

Crell,
@Crell@phpc.social avatar

@menelion Even in v9, that change would break any existing in_array() call where the dev is relying on non-strict behavior. It's impossible to know how many hundreds of thousands of lines of code that is.

I'm a strict typing fan, so I have no use for false there. But IMO the answer is to move away from arrays and build a proper collection trio that is strict by default. (Sequence, Set, and Map, as separate things.)

lordmatt, to php
@lordmatt@mastodon.social avatar

Please don't judge me. I just added two to this project of mine.

Crell,
@Crell@phpc.social avatar

@lordmatt Shame! Shame! Shame!

Crell, to random
@Crell@phpc.social avatar

What is the Bible's take on abortion?

https://youtube.com/shorts/BXb2R0-uj6k

Crell, to random
@Crell@phpc.social avatar

"This vulnerability exploits a design flaw in the WiFi standard, allowing attackers to trick WiFi clients on any operating system into connecting to a untrusted network."

Computers were a mistake...

https://www.top10vpn.com/research/wifi-vulnerability-ssid/

Crell, to random
@Crell@phpc.social avatar

Free markets don't apply to every industry, nor should they. Social infrastructure needs to be handled differently.

https://peakd.com/politics/@crell/social-infrastructure-services

Crell, to Kotlin
@Crell@phpc.social avatar

and are lightyears better than for , at least in the quality of their output. It actually reports something useful, unlike KTLint.

Dear flipping god, how do people work with tools this bad?

Yrrussaj, to wordpress French
@Yrrussaj@piaille.fr avatar

Salut la communauté. Une petite idée de comment on pourrait récupérer localement le contenu d'un fichier toutes les 10 secondes sur un serveur pour l'afficher sur un site qui tourne sur sur ce même serveur. C'est en gros le nom d'un artiste et d'une chanson diffusée en live sur une radio, et on veut l'afficher sur la page web de la radio.

On peut fait ça en quoi ? En ? Avec un plugin ? Et s'il y a 1000 personnes qui accèdent au site en même temps, comment on fait pour éviter de faire 1000 fois la même requête ?

Crell,
@Crell@phpc.social avatar

@Yrrussaj You need JS for that.

Option 1: The client polls for the data. Have a route it can poll that will return just the bare minimum data, and put a 10 second cache lifetime on that response. (Make sure it is cached by your CDN.)

Option 2: Websockets, using ReactPHP or similar, so you can push updates to clients every 10 seconds.

Crell,
@Crell@phpc.social avatar

@Yrrussaj That should work, yes. Make sure your caching is set up properly to avoid hammering your server to death.

If you don't need auth, you could also have PHP just generate a JSON file on disk on a 10 second cron (or whatever schedule), and then serve that file statically. Bypass PHP entirely. Again, need to configure the cache in your web server very carefully for that one file.

Crell, to random
@Crell@phpc.social avatar

I mean... elder Millennials might remember it, vaguely?

Nah, probably not...

Crell,
@Crell@phpc.social avatar

@ramsey @hunter 1980. Proud Xennial. And... I think the economy may have been briefly OK in the mid 90s, before the tech bubble really got going. So, maybe a week...

ramsey, to Symfony
@ramsey@phpc.social avatar

Why does define what appears to be a “real” value for APP_SECRET in the .env file that’s committed to your repository, and then, right above it, there’s a comment that says (in all caps):

“DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.”

Where’s the documentation that explains what APP_SECRET is used for? Why doesn't it put this value in .env.local (ignored by .gitignore)?

Crell,
@Crell@phpc.social avatar

@ramsey I believe it's used for a security key, much like the Laravel equivalent.

Symfony does some very dumb things with env files.

Crell,
@Crell@phpc.social avatar

@tobiaskoengeter @ramsey The entire "commit your .env to use for some app settings, but also have a .env.actual-env that you don't commit that has env-sensitive stuff" is completely broken.

The whole point of a .env is to hold env-specific, non-committed stuff. If it should be consistent between instances, it should be in a config file, NOT an .env.

If you're committing .env to Git, you're wrong. End of story. Symfony wants you to do so. Thus Symfony is wrong.

Crell,
@Crell@phpc.social avatar

@ramsey @tobiaskoengeter This is the Way.

ramsey, (edited ) to random
@ramsey@phpc.social avatar

I managed to avoid for 10 years, but it’s finally caught up to me, so I hope I’m a Kubernetes god after going through all this required (by job) Kubernetes training.

When do I start honking like a duck goose?

Crell,
@Crell@phpc.social avatar

@joepferguson @josh @ramsey That is the correct pronunciation, and I will tolerate no dispute.

Crell, to random
@Crell@phpc.social avatar
Crell, to random
@Crell@phpc.social avatar

How good, caring people became the bad guys...

https://www.okdoomer.io/thebadguys/

HonkHase, to ChatGPT German
@HonkHase@chaos.social avatar

Shtfck 😳🔥😔

#ChatGPT consumes 25 times more #energy than #Google

"Energy consumption by Artificial Intelligence (#AI) is rising rapidly: AI is predicted to consume twice as much energy as the whole of France by 2030, according to some calculations."
https://www.brusselstimes.com/world-all-news/1042696/chatgpt-consumes-25-times-more-energy-than-google

Crell,
@Crell@phpc.social avatar

@HonkHase We need to make electricity more expensive. I hate to do it, but these wasteful trainwrecks always seem to depend on cheap, abundant electricity they can externalize the cost of.

Even a carbon tax wouldn't fully stop them.

Crell, to python
@Crell@phpc.social avatar

Teaching folks the joys of clear and explicit object type definitions. An interesting experience...

Crell,
@Crell@phpc.social avatar

@ramsey

  1. Python has types, they're just elided. Basically just documentation, but use 'em.
  2. Python has @dataclass definitions, and an extension library called Pydantic that's pretty nice.
  3. Lean hard on "if you have a dict where you know the types in advance, make it a class." (Python version of "Never* Use Arrays".)

It's... more capable in this regard than I expected, honestly.

Crell,
@Crell@phpc.social avatar

@ramsey I'm not sure. I'm just relying on my IDE. 🤷‍♂️

designthinkingcomic, to random
@designthinkingcomic@mastodon.cloud avatar

This is me today after a weekend spent gardening. Eurgh.

Crell,
@Crell@phpc.social avatar

@designthinkingcomic I spent a few hours at the woodshop in my local makers space yesterday.

I am still very tired and sore today.

Crell, to programming
@Crell@phpc.social avatar
Crell,
@Crell@phpc.social avatar

@salcode I've done that as well at times, though my muscle memory still has me typing pull --rebase all the time. 🙂

rauschma, to random
@rauschma@fosstodon.org avatar

Have you written a book about web development (recently or some time ago)?
Reply to let us know!

:mastodon: Boosts appreciated (to support book authors on Mastodon).

Crell,
@Crell@phpc.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • tacticalgear
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • everett
  • cisconetworking
  • slotface
  • GTA5RPClips
  • rosin
  • thenastyranch
  • kavyap
  • mdbf
  • Leos
  • modclub
  • osvaldo12
  • Durango
  • khanakhh
  • anitta
  • provamag3
  • ngwrru68w68
  • cubers
  • tester
  • ethstaker
  • megavids
  • normalnudes
  • lostlight
  • All magazines