@shudder@phpc.social avatar

shudder

@shudder@phpc.social

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

syntaxseed, to tv
@syntaxseed@phpc.social avatar

The modern #TV watching dilemma:

Do I keep watching a show I'm really enjoying even though I just learned that the show was cancelled with a huge cliffhanger & the season I'm on is the last.

Does one drive off a cliff if the ride is fun? 🤔😆

#Streaming

shudder,
@shudder@phpc.social avatar

@syntaxseed Unless cancellation was a result of bad writing I'd say go for it.
Cliffhanger is still better than disappointing closure. You can always make up the plot continuation on your own, but it's impossible to fool yourself by pretending that things you've watched didn't happen.

afilina, to random
@afilina@phpc.social avatar

"We had one universe, yes. What about second universe?"
https://youtu.be/6akmv1bsz1M?si=5OV8pCU6xizro3pu

shudder,
@shudder@phpc.social avatar

@afilina Flowing space is so much better description of reality imo. Bent space is like using colors when talking about heights - it's useful for 2D map representation, but not for imagination that would help with intuition.

cabbey, to php
@cabbey@phpc.social avatar

ok folks, you were right Rector is pretty cool. The learning curve is steep AF, and the docs are, well, let's just say they're written by engineers for engineers. But given the target audience for this tool, that's OK. I've not yet done the changes I was originally asking about with it, because the config for it is going to be a PITA to build. I've been starting small. But what I've done so far has been pretty cool! I've done some wild things with RenameClassConstFetchRector for example. 🧵

shudder,
@shudder@phpc.social avatar

@cabbey 2000 files with the same reference? There are more serious problems with that codebase I'm afraid.

Crell, to php
@Crell@phpc.social avatar

Ha! I forgot, I did once do an article version of my arrays talk for php[architect].

https://www.phparch.com/article/never-use-arrays/

Subscribers can get it from the archive. I don't recall if I still have a copy myself I can put on my blog. :-)

shudder,
@shudder@phpc.social avatar

@Crell Oh come on. You've posted your blogpost link before. Don't remember asterisk in the title though, because I thought it was funny when I first saw it as it was right after you've published a library that... used arrays.

syntaxseed, to wordpress
@syntaxseed@phpc.social avatar

Took over maintenance of a new client's site.... and a suspicious stack trace on an error message led me to finding DOZENS of randomly named files & core WP files with obfuscated code in them. 😵‍💫

I've never seen such a thoroughly compromised site before. Uuug.

shudder,
@shudder@phpc.social avatar

@syntaxseed @ericmann @ocramius As a client I'd like to assume you always do your best within budget. Talk to them about the situation and explain why you can't guaratee that "within budget" will be good enough.

Building from scratch shouldn't be much more work if you're adding (I assume replacing) new theme anyway. Unless the faulty plugin is essential & hard to replace.

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

This was so much fun last week so let’s do it again.

Give me an answer and I will tell you the question.

shudder,
@shudder@phpc.social avatar

@grmpyprogrammer It's a programming technique that makes accidental complexity look like essential one.

theshaunwalker, to random
@theshaunwalker@phpc.social avatar

Has anyone had a "this is the best TV show I've ever watched" experiences in the last 5 years?

shudder,
@shudder@phpc.social avatar

@theshaunwalker Wouldn't go as far as "the best show", but only "Severance" comes to mind when it comes to excitement. One of the most original mind-benders in recent years.

thomastospace, to debian
@thomastospace@phpc.social avatar

Installed next to Windows.

While installing, it said it didn't detect another system. If there was one, select No. Then it asked me to select the drive with the system. Did that, installed.

I rebooted, still booted into Windows. No dualboot screen. Luckily I coul still boot into Windows.

I then checked my bios. In boot order, saw a Windows one + one with the drive name. Selected the one with the drive to check.

Now nothing will start and I can't even get into the bios anymore. Help?

shudder, (edited )
@shudder@phpc.social avatar

@thomastospace For system installation it's recommended to leave only system disk connected or enabled in bios (not always possible for nvme drives).

Problems with entering BIOS are caused by OS shutdown directive. On Windows hold shift key while shutting down to remove it.

Ps. I'm in the process of migrating old system to new rig myself and oh man, the ridiculous problems I had to solve made me write my future blogpost draft, because there's no way to remember them all.

davidbisset, to php
@davidbisset@phpc.social avatar
shudder,
@shudder@phpc.social avatar

@davidbisset Hardcoded class map 🥴

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

stripe now requires you validate

  • first your password
  • then your email
  • then your sms

before you can change your bank account info.

which would be fine if when you clicked the window the bank number dialog didnt go away AND YOU HAD TO START ALL OVER

shudder,
@shudder@phpc.social avatar

@bobmagicii "Congratulations! None of our testers has reached this point yet."

dseguy, to php French
@dseguy@phpc.social avatar

abstract logic :

A concrete class can be made abstract again.

A concrete method cannot be made abstract again.

https://php-tips.readthedocs.io/en/latest/tips/abstract_again.html

shudder,
@shudder@phpc.social avatar

@dseguy The thing with inheritance is that it can be used either to create subtypes or to simply reuse some code and make a mess.

hightechredneck, to random
@hightechredneck@phpc.social avatar

An account manager met w/ a client today to discuss their website. He just told me that the client wants to keep their current design but wants to "remodel it". 🤔

What the hell does that mean? Are we "painting the walls" or "rearranging furniture" or are we "tearing down walls"? 🤦🏼‍♀️

Hopefully he clarifies what "remodel it" means before I actually drive to the office and smack him like Gibbs did to DiNozzo. 🤪

shudder,
@shudder@phpc.social avatar
sarah, to random
@sarah@phpc.social avatar

PHP CodeSniffer got forked recently, didn’t it? Or am I imagining that?

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

Sure, most people don't want a hammer, they want a hole in the wall.

But some people do care about hammers, a lot, because their job is to put holes in walls. Or they just like putting holes in walls.

Don't discount either group.

shudder,
@shudder@phpc.social avatar

@Crell "A hammer? Nobody really buys hammers anymore. They're kind of old fashioned." - https://gwern.net/doc/cs/2005-09-30-smith-whyihateframeworks.html

awoodsnet, to random
@awoodsnet@phpc.social avatar

i think people at my coworking space are copying aspects of my computer setup. just noticed that someone has my exact phone stand. a few other people use the same laptop stand . I just started bringing my Moonlander keyboard into the workspace — so we’ll see how long it takes for me to see another moonlander to appear. Does this mean that i’m an influencer? that i’m cool?!

shudder,
@shudder@phpc.social avatar

@awoodsnet You should test the hypothesis by doing something ridiculous, and if people follow: there you go - an influencer 🙃

dgoosens, (edited ) to php
@dgoosens@phpc.social avatar

just remembered that the awesome spread operator ... plays VERY nice with the named attributes of a method

shudder,
@shudder@phpc.social avatar

@dgoosens No need to obfuscate it with call_user_func().
Foo::from(...$args); would also work.

preinheimer, to random
@preinheimer@phpc.social avatar

Our accountant pays google to run their mail servers.

Sometimes when I email them with attachments, the emails don't show up. Not in spam, just ... nowhere.

I have mail server logs showing them getting handed off.

I could not remain in a situation where I couldn't trust my mail server to deliver mail. Not even being able to dig into that problem (e.g. by reading logs) would drive me bananas.

Seriously "I'm not getting some mail, and I can't dig into why" would be taged .

shudder, (edited )
@shudder@phpc.social avatar

@preinheimer Had this problem when I was sending emails with misconfigured or missing spf/dkim/dmarc headers through imported mailbox. It was rejected by gmail, but not the middleman - it could be found there ...in trash bin in my case.

You can test your mailserver config here: https://www.mail-tester.com/

Crell, (edited ) to random
@Crell@phpc.social avatar
shudder,
@shudder@phpc.social avatar

@Crell We need to put more effort into heuristics that would spot them early, because narcisists only look like bullies in retrospect, and when criticism becomes risky, it's already too late.

As the author points out "(...) any one person is only ever as important as the people they can control, either directly through their positions or indirectly through their influence." That's why I'm wary of people who go out of their way to become "important".

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

Today somehow PhpStorm betrayed me and moved a bunch of files around and I am totally confused as to what happened. The only reason I am using it is because it’s Xdebug integration is so much nicer than what I have in NeoVim

shudder,
@shudder@phpc.social avatar

@grmpyprogrammer It happened to me when I played with some innocent looking UML-like plugin toy. Turned out it not only resolved initial (hardcoded) references, but also tried to apply them on the fly. So while I moved a few blocks & drew some arrows, a tornado was going through my codebase (saved by VCS).

Crell, to chicago
@Crell@phpc.social avatar

Anyone in the area, the city council is considering a resolution to condemn the attacks.

shudder,
@shudder@phpc.social avatar

@Crell It's like they came to conclusion that killing people is bad. Let's stop this "thoughts and prayers" bullshit, shall we?

I like when someone points out some unspoken nuance in a messy situation, like terrorists effectively harming both sides, but expecting people to take a virtual stand, so that you (saw your post @azjezz ) could assume they're not a scumbag is just an opportunity for assholes to make themselves look good.

Ps. Would write more, but I'm busy saving the planet. (SWIDT?)

syntaxseed, to php
@syntaxseed@phpc.social avatar

I have a 8.0 project where comparing legacy hashed passwords suddenly stopped working.

I think it's because older accounts are using blowfish ($2a$) and a salt of 21 characters but whatever it was falling back to stopped working because it wants a 22 character salt.

My client now has users with passwords I'm not sure how to validate because I can't replicate the hash.

I guess my next step is to just regenerate & email new passwords. But I don't like it.

shudder,
@shudder@phpc.social avatar
shudder, (edited )
@shudder@phpc.social avatar

@syntaxseed @afilina The easiest solution would be exec wrapper compiled with old versions of crypt_blowfish.c + crypt_blowfish.h (this one might be omitted, but requires editing .c).
For example this
https://gist.github.com/shudd3r/87b06610422bd8f15f9be8a912c64a7e
...would accept crypt() args through command line and output hash.

Though I'm not sure if escaping quotes in password makes it safe enough.

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

still struggling with trying to avoid a specific type of dependency injection.

aka i have a Video. and i have an App. the App has a Config. my Video needs to know the Config to know where to save thumbnails and find api key.

i do NOT want to pass App via DI argument. it negates the entire purpose of building a system and i'm so done with fad development lol.

shudder,
@shudder@phpc.social avatar

@bobmagicii It's called service locator and it's an anti pattern.

You can use it in abstract factory class/callback, where there won't be any dependency on (reference to) values returned from container.

You can also define composition in container itself - it will fail early in concrete place (front controller), so no major drawbacks.

Crell, to php
@Crell@phpc.social avatar

Looking for feedback.

I have a lib build for PHP 7 that has 3 methods:

addFoo($id, $priority)
addFooBefore($id, $before)
addFooAfter($id, $after)

($before/$after refer to some other $id.)

For PHP 8, I am strongly considering just assuming named args and changing it to:

addFoo($id, $priority, $before, $after);

Specify only one of priority/before/after, by name. Multiple is an error.

Is this a good idea/bad idea, and why?

shudder,
@shudder@phpc.social avatar

@Crell If I had to choose I'd say this change is a bad idea. Having single method doesn't bring any value but confusion (call itself is readable tho).

That said, these methods require knowledge of internal structure, so they're either redundant (order of calls in local scope) or serve as a convenience that deals with temporal coupling.

I'd simply remove them, but I feel that "bad code should be hard to write" is not a popular philosophy in php world, so it's a matter of picking fights I guess.

heiglandreas, to random
@heiglandreas@phpc.social avatar

URLs are so simple... </sarcasm>

I quote RFC 3986:

"A fragment identifier component is indicated by the presence of a number sign ("#") character and terminated by the end of the URI"

Guess what is nowhere explicitly defined...

Right! The "end of the URI".

And No! It is not whitespace!

Because "In some cases, extra whitespace (spaces, line-breaks, tabs, etc.) may have to be added to break a long URI across lines. The whitespace should be ignored when the URI is extracted."

😱

shudder,
@shudder@phpc.social avatar

@heiglandreas Whitespace is not a part of URI, so it's one of delimiters. This note only points out that in some contexts you might want to use whitespace for linebreaks, so you need another delimiter in this case.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • kavyap
  • PowerRangers
  • hgfsjryuu7
  • magazineikmin
  • InstantRegret
  • rosin
  • everett
  • Youngstown
  • slotface
  • vwfavf
  • thenastyranch
  • mdbf
  • DreamBathrooms
  • Leos
  • Durango
  • tacticalgear
  • cubers
  • cisconetworking
  • khanakhh
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • tester
  • normalnudes
  • ethstaker
  • modclub
  • provamag3
  • All magazines