Jump to content

Jonathan Lahijani

Members
  • Posts

    730
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by Jonathan Lahijani

  1. Nice to see Linux users here. As for KDE, even though it's more advanced user oriented (my opinion), I like the polish and feel of Gnome more. Also, I want to avoid the whole ricing thing altogether. My need to tweak is very minimal... just a few changes to satisfy my muscle memory with Windows. The feel of the mouse alone without any tweaks is already a huge win (I abhor macOS mouse acceleration). When System76's new Cosmic is done, I will definitely give Pop_OS! a try (it's based on Ubuntu which is good for me). I bought Affinity Designer last year, so I will try to run that in Wine. In the meantime I've installed a bunch of other graphics programs like Photopea, Vectorpea, Gimp, Krita, Inkscape, Pinta. I'm going to install every graphics software I find! ? I also installed the Segoe UI font and enabled it as the default font for Gnome. Segoe UI is a Microsoft font which is the default font for the Windows 11 UI. This change makes me feel more at home and it still looks great with Gnome (sorry Ubuntu Sans). Seriously, not having to adjust my eyes to a new font is a huge win for me. https://github.com/mrbvrz/segoe-ui-linux One other piece of software that is absolutely great on Windows is XYplorer. It has a bunch of features, but one that I really miss is the ability to tag files with colors (similar to how macOS allows it in Finder). Any file manager recommendations? I've tried many but maybe I'm missing something important.
  2. Over the years there's been a growing part of me that's wanted to be a full-time Linux user. I've been using Windows from the beginning and attempted to switch to macOS a few years ago (given the excitement of M1) however I gave up after 8 solid months because I came to dislike some issues that I couldn't circumvent in macOS. Due to some fear, impatience and most importantly, software compatibility, I have not made the switch to Linux, but times have changed. I've played around with the big distributions (Ubuntu, Debian, Fedora, etc.) in some way or another. I've grown extremely comfortable with Bash, the command line and have the confidence in working my way out of issues (a lot of this is due to the hardware business I was involved with for 7 years which sharpened by skills). I've dealt with installing Nvidia drivers in every which way too (if you know, you know). Whenever Ubuntu releases an LTS version, I tend to experiment with it and I did so last night with 24.04. Really annoying things like not being able to move the taskbar from the left to the bottom without having to use extensions that could break, are now natively supported (IIRC you couldn't do this so easily before). That sounds like a minor nit-pick but if there's something I know about myself, it's that if I don't have to reprogram my muscle memory, I will have an easier time. The mouse movement feels Windows-like (this truly annoyed me with macOS despite trying every program and tweak in existence) and font rendering doesn't seem to bother me as much as macOS. Again these seem like minor nit-pick type things but to me they matter. At this point, it comes down to software compatibility. I'm not some hardcore Office user and I barely use it beyond basic word processing, so that's not an issue. The only other software suite is Adobe CC. I do rely on Photoshop and Illustrator, but not for "creating" but rather tweaking. I've built some muscle memory with those apps as well but I can't let them hold me back. I know Photopea exists which many have raved about being a great Photoshop alternative and which supports PSD quite well from what I've heard. So that's always an option combined with Gimp or Krita if I don't have to deal with actual PSD files. Maybe I'll set up a VM with Windows to help ease the transition. So at this point, there's nothing holding me back. I installed Ubuntu 24.04 on my main system along-side Windows (dual boot). In a couple months, I will try to switch. Any other desktop Linux users here? BTW, I'm sticking with Ubuntu because I like how it's Debian-based. I know there's some disagreements with snaps being used, etc., but because it's the most popular Linux distro and feels polished enough and similar to Windows, it's the best place to start (and maybe stay).
  3. I've created a GitHub issue here: https://github.com/processwire/processwire-issues/issues/1938
  4. I want to set up one of the many self-hosted project management systems that exist, but I haven't really thought about this since the late 2000s (I experimented with Redmine a long time ago). My needs are not intense. It's mostly ticket creation and tracking. What's a good, preferably PHP-based, system that you recommend? Some options: https://github.com/awesome-selfhosted/awesome-selfhosted?tab=readme-ov-file#software-development---project-management
  5. Something I was thinking about today was what are the pros and cons of ProcessWire being "dependency-free" in the sense that it doesn't rely on a separate web application framework? For example, Craft CMS is built upon Yii. Drupal, if I understand the history correctly, switched from their home-grown approach from v7 to Symfony in v8. WordPress is home-grown. ProcessWire is home-grown as well, right? I would imagine the biggest pro is that ProcessWire doesn't have to "answer" to anyone, follow a separate web application framework's opinions and update schedule and things like that. Would ProcessWire be what it is today if it had such a large separate dependency? Of course, pulling off a home-grown way of doing things is a monumental task that requires great skill, but Ryan seems to have pulled it off (which is probably why we're all here). I've come to appreciate this decision but wanted to get the opinions of others here as well.
  6. Hey man, I coined that term! (patent pending! j/k) I would really love to hear your Laravel/ProcessWire experience and comparison in terms of web application development. I too have been working on a very large webapp with ProcessWire over the last 6 months using ProcessWire, Alpine and HTMX (no need for Tailwind since it's completely admin side, although I did nearly completely develop AdminThemeBootstrap as an experiment during this project which I may or may not use in the future on it).
  7. @Robin S Thanks for that detailed example. I actually did experiment with that hook before my post as well, and as your example demonstrates, you kind of have to hack it to show grandchildren in-line with their parents. Sorting then becomes weird because they are technically at different depths. This isn't the best UX. Ideally, if you expanded/opened the "Colors" child page, then it would show it's children "contained" inside of it, in a way that's somewhat similar to nested repeaters without repeaters. I was wondering if native support for the approach I described would be too much of a stretch given how PageEditChildren is currently programmed.
  8. @ryan For PageEditChildren, would it be a stretch to have it support editing a children's children from the grandparent page as well? I typically have an /options/ page, and under it I have my page-based options... for example "Colors", "Sizes", "Order Statuses", like this: Options (template is 'options') Colors Red Green Blue Sizes Small Medium Large Order Statuses Pending Canceled Complete If I were to activate the 'options' template in PageEditChildren, I will be able to edit only the "Colors", "Sizes" and "Order Statuses" holder pages, not their children (from within the holder pages) which are the actual options themselves. Is there a way to perhaps support this? This is something I've been meaning to address more nicely in the past, but PageEditChildren would solve it with being able to edit grandchild pages.
  9. Consider checking 404 logs and see if there's excess traffic to nonexistent pages. If so, and depending on you are handling those and if they are pages that take a lot of database power to generate, handle accordingly. Bad traffic can sometimes cause performance issues.
  10. I wish I could write a longer reply but I'm going to be unavailable for a solid week, however check out what I wrote here (wrote it last week) which includes a lot of bullet points that you may find useful: https://github.com/jlahijani/awesome-processwire?tab=readme-ov-file#why-processwire Also welcome to the forum. You'll be in good company!
  11. OK I answered my own question. I need to use noHooks: wire()->addHookAfter("Pages::saved(template=basic-page)", function(HookEvent $event) { $p = $event->arguments('page'); $p->title = time(); $p->save(['noHooks'=>true]); }); You beat me by 5 seconds!
  12. I don't remember if I've dealt with this properly before, or if I just used setAndSave to avoid the issue. But it brings up a question on how to do it the right way. My overall question is how do you properly attach a Pages::saved hook and again save the same page without causing an infinite loop? Let's say I have a hook like this: // works, but must setAndSave each field; doesn't seem ideal? wire()->addHookAfter("Pages::saved(template=basic-page)", function(HookEvent $event) { $p = $event->arguments('page'); $p->setAndSave('title', time()); }); That will work fine if I save a page or multiple pages using the basic-page template. OK. But if I want to save a bunch of different fields instead of just title, what is the correct way to do it? These will cause an infinite save loop: // causes infinite save loop wire()->addHookAfter("Pages::saved(template=basic-page)", function(HookEvent $event) { $p = $event->arguments('page'); $p->title = time(); $p->some_other_field = 'foo'; $p->save(); }); // this also causes infinite save loop wire()->addHookAfter("Pages::saved(template=basic-page)", function(HookEvent $event) { $p = $event->arguments('page'); $p->title = time(); $p->some_other_field = 'foo'; $p->save(['title', 'some_other_field']); }); If I remove the hook, it will save the page, but since the hook gets removed, it will only apply to the first page: // fixes infinite loop but hook gets removed; see below wire()->addHookAfter("Pages::saved(template=basic-page)", function(HookEvent $event) { $event->removeHook(null); // remove the hook! $p = $event->arguments('page'); $p->title = time(); $p->some_other_field = 'foo'; $p->save(); }); // only the first page will run the hook since it is removed foreach($pages->find("template=basic-page") as $p) { $p->save(); }
  13. Has there been an updated, more formal, non-MagicPage approach to this yet? Is there anything wrong with doing this so at least the hook is "closer" to the page class? <?php namespace ProcessWire; // this is /site/classes/OrderPage.php // hook above class so it's "closer" wire()->addHookAfter("Pages::saved(template=order)", function(HookEvent $event) { $order = $event->arguments('page'); // hook code }); class OrderPage extends Page { // ... } Related GitHub issue since I don't think it's linked in any of the replies above: https://github.com/processwire/processwire-requests/issues/456
  14. @Robin S Not yet but at least for now, the files existing there serve as a visual reminder.
  15. Incorrect! You must demonstrate to employers you understand React because everyone is using it (aka Resume Driven Development). Here's what ChatGPT recommends to write in resume-speak (it took a few refinements to get this): "Acquired advanced proficiency in React.js through extensive development experience with WordPress Gutenberg."
  16. My eyes. I think String Theory will be easier to comprehend. Seriously though, imagine in 4-5 years as the team behind that creation withers away (as they find new jobs) and the domain knowledge leaves the company, with new team members taking over and having to maintain and build upon THAT. It's going to get worse before it gets... worser? WordPress is bad for your mental health.
  17. I've been using ProcessWire for a long long time and over the years my techniques and go-to approaches have been constantly refined. A lot of this knowledge is codified in my internal heavily opinionated starter module that sets up everything up the way I like. Even with that, there are other tips, techniques, and modules that I may use occasionally on client sites and because of that, I may not remember them months or years later. I do have a document that I've been better at updating recently with this information, but in addition to that, I think to really remember a piece of knowledge it's best to actively use it even if not necessary. The best place I've found to do this is on my personal website. I treat my personal website as a semi-testing ground, a reminder of techniques and the generally the first place I will use something that maybe gets used on my other client websites. Even if I don't really need some specific module, need that odd hook, or require a specific setting, I will deliberately use it on my personal website because I have total control over it, it's live (meaning I have both a development and production version which allows me to test my deploy and sync scripts) and if something breaks temporarily it's not a big deal. For example, I'm doing the following on my personal site: various hooks that modify the admin; adding custom markup fields in the page editor for certain templates using dotenv (maybe eventually use this everywhere, but only here for now to codify the latest approach on this) using rockshell with some custom commands that I don't really need have a random snippet for tracydebugger in /site/templates/TracyDebugger/snippets/ created all the other special status files in /site/ (boot.php, download.php, failed.php, render.php) blocking the vendor folder in .htaccess have a random rewrite rule in .htaccess using ProcessRedirects with a random rewrite rule disabling sessions purposely have a dash in the name of my database (did you know Microsoft purposely put a space in the "Program Files" directory so that developers properly handle paths with spaces in it?) using Page Edit Lock Fields on my home and about page (yea, locking the page from myself!) experimenting with the AdminBar module and hooks, even though I won't use this module (I have my own admin bar that loads via ajax) overriding styles in the ProcessWire's admin bar (making the font small, smaller spacing, full width container) have a humans.txt file separately, using Matomo even though I don't really care about analytics for this site my deploy script deploys some extra random directories even though I don't need them have a separate user account that's been assigned the AdminThemeBootstrap theme I am working on using a honeypot field on my formbuilder-based contact form (I use this everywhere) I have a note (which is basically the above list) that I add to so it's easy to remember what I did, why and references to it (forum post, github, blog post, etc.). --- Separately, I have another completely blank ProcessWire installation with nothing extra done to it (except TracyDebugger). I use this to test and experiment various things (sometimes unrelated issues) when I don't want any hooks or installed modules potentially modifying anything. I'll also install modules here that I'm not so sure about. If I suspect I hit a bug with ProcessWire in a separate installation, I'll experiment here as well. Once I'm done fully experimenting and the issue has been resolved, I'll make a note in a log of what I did then undo my changes bringing it back to a clean slate.
  18. @FireWire Pssh. All these issues you speak of are the "old" WordPress from the late 2000s and early 2010s. You are not using the fantastically re-envisioned NEW WordPress which totally solves all these problems by bringing in React to build Gutenberg out of the carcass of classic WP. It is NOT a s***-show. Here, just read this new glowing review: https://dbushell.com/2024/05/07/modern-wordpress-themes-yikes/ HN Discussion: https://news.ycombinator.com/item?id=40296534
  19. I was dusting off my Awesome ProcessWire repo and updating it with more relevant information. One thing that bothered me is that the various links I have in there to forum posts may have changed, but this forum software correctly forwards it to whatever the latest URL is. While the forum doesn't expose an actual canonical URL for a post, I found this little hack to make it as minimal as possible. Let's say you have this URL: https://processwire.com/talk/topic/29951-weekly-update-%E2%80%93-26-april-2024-%E2%80%93-profields-table-v29/ That bothers my "OCD" and if the post title were to be changed, the URL would change accordingly, but I figured out you can chop off everything after the post ID and following dash and add an extra dash if you want a canonical-like, minimalized URL. It would look like this: https://processwire.com/talk/topic/29951-- (two dashes required)
  20. Would it be possible to edit the 'name' field of a page as well?
  21. This is awesome. I use PageTable with a slight hack to accomplish what's shown here, but that will go away now. Also there's a typo with the word "ediable" in the module settings.
  22. With every PW website, I usually create a folder in the root (let's call it "something") where I store various scripts that do random things (most of these scripts act on ProcessWire directly so I bootstrap it). I execute them either by visiting the url in my browser or using the terminal. There's a bit of security through obscurity with this approach that feels wrong. Using something like RockShell is probably the more formal way to do it, but sometimes it may not be the right choice for short-lived scripts or scripts that don't act on PW directly, or if the script is written in Bash. Also I haven't started using RockShell regularly yet although that's the plan (I'll have to convert a lot of sites). So my question is, what is your go-to approach in terms of where to store and how to handle supporting scripts like I described?
  23. For what it's worth, I switched from MySQL to MariaDB on my local dev server which is running Ubuntu 22.04. Importing a db dump that uses InnoDB is 7x faster in MariaDB. I tried making it faster in originally in MySQL by adjusting a bunch of settings without luck. Switching to MariaDB with its default settings is much faster based on my simple test. Edit: It seems the reason the speed is much faster has to do with MariaDB disabling binary logging by default while MySQL doesn't which is probably the more accurate explanation: https://dba.stackexchange.com/questions/327303/mysql-8-twenty-times-slower-than-mariadb-10-3
×
×
  • Create New...