Posts

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

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

I love deleting code more than I appreciate writing elegant code.

Especially when I can do it without losing functionality. It’s like the ultimate refactor win for me.

Just thought I’d share.

shadowhand,
@shadowhand@phpc.social avatar

@itsjoshbruce heck yes. I just had a PR that deleted ~300 lines of code without any change in functionality. 💯

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Experimentation in the following continues:

  1. Less code
  2. Fewer packages (1 package that depends on 50 = 51 packages)
  3. Still have robust dynamic sites

No more databases (not even flat-file). No more admin panels (that’s changing, kind of). Now I’m contemplating abandoning the belov’d front controller + router.

If you would have told the 2005 version of myself this is where I’d be 20 years later, I would’ve laughed in your face before panicking that someone would take away my precious.

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

Oh. And probably the most valuable one that sparked off this experimentation:

  1. Let the server be the server.

It’s interesting how much code we write to do what the server can do out of the box.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@bobmagicii: That’s fair. I appreciate the work folks do. And, to give credit where due, the PSL has a lot going for it.

The other day I contemplated a package. It wouldn’t install because it and another package depend on different versions of the same underlying package.

I decided to just install the underlying package. Now, I’m pretty sure I’ll just remove that package entirely, because I can easily get there without it.

itsjoshbruce, to php
@itsjoshbruce@phpc.social avatar

It’s been so long since I did anything with authenticated users, curious about “modern” patterns and standards.

Specifically, an authenticated user wants to do something. What patterns and standards are you using for permissions?

I’m seeing middleware mentions. But, curious what else is out there. Not looking for “use Framework X” and should be testable. Doesn’t need to be web-specific as I’m just looking for patterns and standards.



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

@oliver: Right on. Is it the user or the request falling through the middleware checks?

oliver,
@oliver@phpc.social avatar

@itsjoshbruce it's the request (route or route group middleware). Authenticated user is set early to the container and then various areas are protected based on the user's roles. Of course, there are more detailed checks later in the flow (e.g. parts of the interface are hidden or different depending on role/permissions). Middleware is stopping the unintended actions, like playing with URLs to access what's not supposed to be seen or actioned on.

itsjoshbruce, to php
@itsjoshbruce@phpc.social avatar

Learning how to do a thing.

Pretty sure it’s possible; never tried and haven’t been pulled to do so.

PHP creates sessions. Using cookies, it creates a cookie named: PHPSESSID (or similar).

I’d like to customize this; clean and simple.

Goal: I’d like to not have the PHPSESSID cookie. Not finding it.

Thinking:

  1. Disable session cookie
  2. Implement SessionHandlerInterface
  3. Set mine as the save handler
  4. Pass my session cookie in response header

Feel like I’m missing something.

derickr,
@derickr@phpc.social avatar

@itsjoshbruce Maybe set the https://www.php.net/manual/en/session.configuration.php#ini.session.name setting to something that isn't PHPSESSID? You're... going to need a cookie regardless.

derickr,
@derickr@phpc.social avatar

@bhhaskin @itsjoshbruce Yes exactly... so what would you want to do different?

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

I have an affinity for: Wait until the last responsible moment.

I've been contemplating Continuous Deployment on my personal site for years: https://joshbruce.com

But, before I did, I embraced the @jezhumble line: If it hurts, do it more often, and bring the pain forward.

I could deploy my sites in less than a minute using my phone by the time I hit the ceiling of the manual process I used.

Becca and I are ramping up on TIA: https://the-irreverent-agilists.com



itsjoshbruce,
@itsjoshbruce@phpc.social avatar

It's worth noting I could have done it through GitHub Actions, but I decided against that.

In part because I don't want to be even more tightly coupled to GitHub and its infrastructure.

If I switch to some other remote Git solution, if it has webhooks, I should be able to update the script in short order (there are zero dependencies for the script I wrote, and CI through GitHub Actions says it would work in PHP 7.3, I haven't tried going farther back).

That was my Saturday. How was yours?

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

ps. The time from merge to visible so far has been less than 1 second. (Locally, the script runs in about 300ms and uses one exec call.)

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Your dude was on another podcast: https://www.earnandinvest.com/episodes-8/where-to-invest-when-markets-are-shaky

Specifically, The Earn and Invest podcast community episode. It was great fun.

The idea of including cash in your "portfolio" was an interesting topic, and it made me think of The Universal Portfolio essay: https://joshbruce.com/essays-and-editorials/finances/the-universal-portfolio/

Winding down on Time: Mastering the Mundane, and Money: Mastering the Mundane is ramping up. I should revisit that essay to cover the logic and rationale leading to it.

itsjoshbruce, to webdev
@itsjoshbruce@phpc.social avatar

One of the nice things about being able to write software is when a software company (or series of them) frustrate me enough, I can just write my own.

The drawback is actually doing it.

I’m glad I’m not a data hoarder. Trapped into using software because, “They have all my data!”

I guess we’re back in software mode…unless…

You know of a completely standalone bookkeeping application that doesn’t suck (no account connection needed).


jbrains,
@jbrains@mastodon.social avatar

@itsjoshbruce I don't know what "sucks" means to you in this context, but I've dived headlong into this world:

https://plaintextaccounting.org/

My accountants did not fire me yet, which I interpret as a good sign. And I am free of QuickBooks for the first time since 2001.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@jbrains: Sorry it’s taken a minute…that was a great rabbit hole I just fell down!

I appreciate the ethos behind the solution. Very inspiring.

itsjoshbruce, to webdev
@itsjoshbruce@phpc.social avatar

I guess I’ll finally get around to implementing continuous deployment for my website projects. Mainly because Becca and I plan to start building out and writing content for The Irreverent Agilists: https://the-irreverent-agilists.com

Still avoiding building an admin panel for the win. It still surprises me how little code even a dynamically generated website needs when you remove the admin panel. Web 1.0 is fascinating in the 21st century.



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

Note to future me: You are glad you stopped using Homebrew, and never left it installed when you did.

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Pretty sure the con drop hit today.

Ready for bed; despite 99% recovery on WHOOP.

It was fun driving from Portland to Louisville. Love driving that part of the country. Also, the bad weather was nonexistent.

It wasn’t fun starting the journal with the beginnings of a sinus infection. But, I started combating it the moment I woke up to a clogged nose. So, was rapidly clearing up by the time we left on Sunday.

Feel like I didn’t get shit done. But, it’s more like I did low-energy things.

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Latest health and wellness article: https://joshbruce.com/experiences/health-and-wellness/historical-summaries/202403/#thursday-march-28-2024

I’m allergic to Portland, Oregon. Managed to avoid full-on sinus infection. And had fun at Agile Open Northwest.

Also, still enjoy driving cross-country.

itsjoshbruce, to webdev
@itsjoshbruce@phpc.social avatar

I tend to think we lost the benefits of mobile-first design and development when we emphasized fluid layouts instead of accounting for:

  1. crap (and unstable) connections,
  2. limited processing power,
  3. limited I/O capabilities (ex. no hover and less precise),
  4. constrained on-device storage, and
  5. limited data plans.

(I’m sure I’m missing a couple.)



itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Agile Open Northwest was loads of fun. Met some great people. Saw some familiar faces. And, finally met some folks I’ve followed for a while in person(h/t @qcoding).

Evening coding sessions were also interesting to participate in.

Good feedback on the session I did on The 5 Ps and the one Becca and I did together as The Irreverent Agilists: No Spikes in the Mosh Pit.

https://joshbruce.com/essays-and-editorials/the-5-ps/

https://the-irreverent-agilists.com



itsjoshbruce, (edited ) to accessibility
@itsjoshbruce@phpc.social avatar

Does anyone know of a tool or approach for having a printed book read to you (they, and I, don’t do well with reading print)?

Specifically, this book: Donald Featherstone’s Solo Wargaming

Was going to recommend screen reader + ebook; can’t locate ebook version.

Update: Their trying a Google app for Android called Lookout: https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.reveal


SirSid,
@SirSid@phpc.social avatar
itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@SirSid: Definitely cool. Might be on the expensive side. :(

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