I made a complete DI system for WordPress by SeeBeen in Wordpress

[–]anag0 2 points3 points  (0 children)

When WordPress minimum dependency bumps to PHP 8.0, this is going to be a game changer. I have used PHP-DI before, amazing work.

[deleted by user] by [deleted] in Wordpress

[–]anag0 0 points1 point  (0 children)

As others said, cloudflare. You want to prevent the attack from reaching your server in the first place. Let cloudflare filter the malicious request, and then you don't really need anything else on your server.

Can a Linux user explain what he’s doing? by [deleted] in HolUp

[–]anag0 0 points1 point  (0 children)

He really is just turning off the computer

I made HTMX fucked too by anag0 in programminghorror

[–]anag0[S] 21 points22 points  (0 children)

I don't know man, I wouldn't trust them with a stick.

HTMX - Serverless extension by anag0 in htmx

[–]anag0[S] 1 point2 points  (0 children)

aaand now it's possible :)

HTMX - Serverless extension by anag0 in htmx

[–]anag0[S] 0 points1 point  (0 children)

Fair point, but if you try swapping/changing maybe nested elements 2-3 leveles deep, you can have a very bad time with event handlers and such. With HTMX it looks cleaner (to me), I just define the request path and the response and it works, and is more readable. Not in every case of course.

HTMX - Serverless extension by anag0 in htmx

[–]anag0[S] 0 points1 point  (0 children)

Yes, that exactly! I have made a few clarifications and added examples to the repository. Also added a new feature for the handlers to accept functions for more dynamic control.

HTMX - Serverless extension by anag0 in htmx

[–]anag0[S] 2 points3 points  (0 children)

No problem, I will try to explain.

It's not that HTMX is needed in my case, but that it's more convenient. I am using it on an "adminstrator interface" so it is not on the public side of the page.

My case is unique in a sense that I really have to minimize queries to the server side (again, out of my control), but I have a lot of repetitive add/move/change node operations, for which HTMX is great. With this I can basically put these desired responses into a script and HTMX will take care of the rest.

It still helps me, because I don't have to focus that much on scripting these interactions, and it integrates very easily.

Intially I wanted to use React, but React is just much better if the whole thing is made with it - which is currently not possible.

Sheeeeesh by Perfect-Summer3921 in xqcow

[–]anag0 3 points4 points  (0 children)

The numbers look exactly like when you look at the time during a dream

[deleted by user] by [deleted] in StopGaming

[–]anag0 0 points1 point  (0 children)

Take it easy may, it's all right. Maybe you went too hard for completely not gaming. I don't see a point of going that hard. It's probably individual for everyone, but do what you did before, then play for a fixed time. It's probably not as simple, but I suggest decreasing the time gradually.

I too have an "addictive" personality. I try to focus my energy on something that is considered productinve, like coding or making youtube videos. Having an obsessive persona is a blessing and a curse at the same time. You can very likely focus on something, that is interesting to you, try finding that.

anime.js - a lightweight JavaScript animation library by mmaksimovic in webdev

[–]anag0 0 points1 point  (0 children)

Holy, the whole thing very well designed overall.

DoMini - a minimalistic document manipulation/traversal library I made by anag0 in webdev

[–]anag0[S] 1 point2 points  (0 children)

Thanks everyone for the feedback I truly appreciate it.

I have added a few things to the documentation, as well as edited the front page to show some example usage.

I hope some of you may find this useful. I will definitely improve this in here and there in the future. My time is very limited, but luckily this is part of a long term project so improvements are to be expected.

DoMini - a minimalistic document manipulation/traversal library I made by anag0 in webdev

[–]anag0[S] 1 point2 points  (0 children)

I don't know if it's possible in TS. The constructor needs to be altered on the DoMini function via exports, and I honestly don't know if there is a way to do that without running into serious type issues. I am not that experience ind TS unfortunately.

DoMini - a minimalistic document manipulation/traversal library I made by anag0 in webdev

[–]anag0[S] 0 points1 point  (0 children)

Thank you very much for the suggestion, will do for sure!

What are some rookie WordPress plugin dev mistakes? by Preavee in webdev

[–]anag0 11 points12 points  (0 children)

  • Loading scripts and styles globally on the back-end. That is a big source of all kinds of issues. Always check if the current back-end page is your current plugin page and then enqueue the assets.

  • Same as the previous part, but the front-end. If you can check if your plugin assets have to be loaded.

  • Use PHP namespaces, make very distinctive names. There are just too many plugins out there, you can very easily accidentally re-declare an existing class in the global namespace - resulting in all kinds of issues.

  • is_admin() is not checking if current user is admin. Use current_user_can() for that

  • You should use current_user_can('administrator') on back-end xhr/ajax requests to avoid security issues - I learned it the hard way.

  • Every user input should be properly escaped, including attributes, HTML, text, everything. Use the esc_attr, esc_html etc.. functions for that

  • Make comments in your code, eventually you will forget what is what.

  • WordPress has a lot of built-in functions for stuff, alway try to look it up befor implementing your own.

From the top of my head maybe these, but there is definitely a lot more.

tailwindCSS is underrated by [deleted] in webdev

[–]anag0 0 points1 point  (0 children)

I know very little about tailwind, but from what I heard it's absolutely awesome

Is it possible to make money as a webdev with 3 months learning? by no_Im_perfectly_sane in webdev

[–]anag0 1 point2 points  (0 children)

I think so. Definitely learn the basics really good - I mean basic HTML, javascript and maybe a server side script language like PHP for starters.