chraebsli

joined 1 year ago
[–] chraebsli@programming.dev 1 points 53 minutes ago (1 children)

Hey thanks for the comment!
The plugins don't get maintained by me, they're getting maintained by the Grav team. I'm not very good in PHP too.
I plan to create an issue on GitHub if I know more and probably identified the code causing the problem.

[–] chraebsli@programming.dev 1 points 2 hours ago (3 children)

Every shortcode is a PHP class and looks like this:

<?php

namespace Grav\Plugin\Shortcodes;

use Grav\Common\Utils;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;

class ClearBothShortcode extends Shortcode
{
    public function init()
    {
        $this->shortcode->getHandlers()->add('clearboth', function (ShortcodeInterface $sc) {

            // Get shortcode content and parameters
            $str = $sc->getContent();

            $output = '<div style="clear: both;"></div>';

            return $output;

        });
    }
}

with that, it should be possible to only call these classes.

 

I just spent 6 hours of debugging some code, just to find out I had to delete a line in a .gitkeep file:

I'm developing a Grav skeleton, which is a kind of template for Grav CMS to easily create sites with it. Such skeletons can include themes and plugins, which can be used to enhance its features and make individual sites.

Now I had this error that the sitemap.xml (used to tell search engines which pages should be indexed and where to find them) threw an error because the XML declaration wasn't on the first line as it should, but on the 2nd line. It came out that every page had this empty line, no matter if html, json or xml.
To find the bug causing this, I first disabled all plugins and enabled them step by step to find out which one produces said bug. It was the shortcode-core plugin, which can be used to style text with more than just markdown. Since this plugin isn't related in any way to the sitemap plugin, I searched for other possible error sources.
After some playing around, I found out that when I remove a theme, the bug simply disappears. With that info, it had to be a problem with said theme. Since themes can include custom shortcodes and the shortcode plugin did make some "noises", I started investigating a bit more with that. While trying to find the bug, I accidentally deleted the shortcode folder, which had only a .gitkeep file in it. This file was necessary that the folder persist with git versioning because if there was no such directory, the plugin would output an error message. I then recreated the folder manually and the error was still gone. Even after recreating the .gitkeep file, there was no empty line in the output.
After trying to find the bug, I checked git to see which edit made the bug resolve. And there was it: the .gitkeep file I recreated had some changes? But I didn't make any changes to the file except for recreating it. Wrong. The file originally had 2 empty lines, probably accidentally. And by recreating the file, it only had one line which resolved the bug.

It came out that somehow the shortcode plugin tried to get shortcodes from this file and likely added the 2 empty lines to the output. And an empty line before the start of the XML declaration causes the XML parser to output an error. Deleting the 2nd empty line from the .gitkeep file removes the empty line from the output and the error is gone. Bug fixed.


And I spent 6 hours today with the help of a kind stranger in a discord channel who was a bit like a 2nd brain to me. It really helped having someone who hasn't worked on this skeleton and could see some bugs you don't see because you're too familiar with it ("Betriebsblind" in German).

Edit: The plugins don't get maintained by me, they're getting maintained by the Grav team. I plan to create an issue on GitHub if I know more and probably identified the code causing the problem.

[–] chraebsli@programming.dev 4 points 5 days ago

didn't know they had this feature all the time😳

[–] chraebsli@programming.dev 11 points 5 days ago (1 children)

I'd just import it as TwitterIcon

[–] chraebsli@programming.dev 1 points 1 week ago (1 children)

She doesn't have much money for a new laptop and since she won't use it often, it's enough to check mail, e-banking, ... And we have some old laptops at home nobody uses, so we thought we could give it to her as a gift.

Eventually, she'll buy a new ~400$ laptop later with some good specs, but that's not in the upcoming months. But thanks for the help.

[–] chraebsli@programming.dev 10 points 1 week ago (1 children)

Yeah, it's an old laptop. She doesn't have much money for a new laptop and since she won't use it often, it's enough to check mail, e-banking, ... And we have some old laptops at home nobody uses, so we thought we could give it to her as a gift.

Eventually, she'll buy a new ~400$ laptop later with some good specs but that's not in the next few months. But thanks for the tips.

[–] chraebsli@programming.dev 4 points 1 week ago (4 children)

Wow... thanks for this detailed info & guide! I'll probably use the HP laptop with Mint Cinnamon, cause I don't like that old retro look of xfce. A friend told me to try Lubuntu too, so let's see.

I didn't know about that Chrome/ Firefox performance "issue" on old laptops, so thank you! Isn't there a way to disable flatpak at all? Thought on my Manjaro I could disable it, so eventually there is an option there too. OnlyOffice and uBlock were my guesses too. I'll probably set up NextDNS and KDE Connect too.

 

cross-posted from: https://programming.dev/post/19622913

A friend of someone related doesn't have a laptop nowadays, but needs one. Now we have 2 old laptops at home, and we want to give her one so she can do some things on it. Since she isn't used to laptops and the old laptops wouldn't run a Windows 11 (I don't want to install a Win10 because of end of support and lacking security features), I guess installing a simple Linux is fine. Now comes the big question: Which Linux distro should I install? (see requirements below)

Laptops:

  • Acer Aspire ES 15, AMD dual-core E1-7010 @1.5 GHz, 4GB RAM, 1000 GB HDD
  • HP Pavilion 17-e030ez, Intel Pentium @2.4 GHz, 4GB RAM, 10000 GB HDD (I'd choose this)

Tasks:

  • Office Stuff (I thought about OnlyOffice)
  • Internet surfing
  • Banking via Web

Requirements:

  • needs to have full German support
  • needs an easy software installation center
  • should be easy to learn
  • optionally, her friends (which probably use Windows/ Mac) should be able to help her (since she never had a laptop before)
  • eventually German forum/ German Guides

I'm using Linux/ Manjaro for myself but don't have any experience with beginner-friendly distros. I used a KDE neon for some time and also have used Ubuntu, and to be honest, they seem beginner-friendly too.

Please let me know your opinions, thanks!

 

A friend of someone related doesn't have a laptop nowadays, but needs one. Now we have 2 old laptops at home, and we want to give her one so she can do some things on it. Since she isn't used to laptops and the old laptops wouldn't run a Windows 11 (I don't want to install a Win10 because of end of support and lacking security features), I guess installing a simple Linux is fine. Now comes the big question: Which Linux distro should I install? (see requirements below)

Laptops:

  • Acer Aspire ES 15, AMD dual-core E1-7010 @1.5 GHz, 4GB RAM, 1000 GB HDD
  • HP Pavilion 17-e030ez, Intel Pentium @2.4 GHz, 4GB RAM, 10000 GB HDD (I'd choose this)

Tasks:

  • Office Stuff (I thought about OnlyOffice)
  • Internet surfing
  • Banking via Web

Requirements:

  • needs to have full German support
  • needs an easy software installation center
  • should be easy to learn
  • optionally, her friends (which probably use Windows/ Mac) should be able to help her (since she never had a laptop before)
  • eventually German forum/ German Guides

I'm using Linux/ Manjaro for myself but don't have any experience with beginner-friendly distros. I used a KDE neon for some time and also have used Ubuntu, and to be honest, they seem beginner-friendly too.

Please let me know your opinions, thanks!

[–] chraebsli@programming.dev 26 points 2 weeks ago
  1. using an ad blocker. personally, i use ad blockers for years and when i work on a friends laptop im shocked how much ads there are actually. i cant count on a hand how mucn i told my father he should use ad blocker browser and extenstion. and he wont do it. recently, i changed the DNS server on a router level to nextdns, where it blocks ads and trackers. he told me its amazing how smoother the experience is now

  2. password managers. as an IT specialist i have about 300 login details for many services, personal, work and clients. every login has its own password and eventually email too. and i know sooooo many people who forgot their passwords (they have about 3 very similar ones but ok) and try them all until they find out they had to creat a new for that specific service. and they are so unaware about the dangers (for example fishing, SE, ...) with this method.

[–] chraebsli@programming.dev 1 points 2 weeks ago

I'm using Brave cause I love and need Chromium. Firefox and Vivaldi are great options too.

You could use a PiHole or nextdns.io too as a DNS blocker against ads and trackers.

[–] chraebsli@programming.dev 11 points 3 weeks ago

Had to do these to view some Twitter/X post a friend sent me: I don't have an account and visiting the link redirects directly to login. So I created a new account with a temp mail. Then I had to solve 10 of these riddles. After the 10th there was an error message that I cannot use this email or so. I asked my friend for a screenshot afterwards. I had a loooong day and it was very late in the evening. I never ever do this again. Shitty SM.

[–] chraebsli@programming.dev 1 points 1 month ago (1 children)

I started using linux by setting up a dual boot: using windows only for things I couldn't do at the time on linux. That were gaming and some apps only supported by windows After usig it for some time I now have everything on linux (or an alternative) and uninstalled windows. Still in the process of figuring out some very specific stuff like you with your Quest, but someday I just couldn't have it with windows anymore.

There are a lot of ressources online and some distros are really great for gamers/ newcomers. Just give it a try and some time. You will have to learn some things like you had to with first using windows.

[–] chraebsli@programming.dev 2 points 3 months ago

Actual definitions (my opinion):

  • HTML is website
  • CSS is style
  • JS is everywhere
  • SQL is data
  • Python is simple
  • PHP is backend
  • Markdown is README
  • YAML is config
 

Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
920
Songs about Vim (programming.dev)
submitted 6 months ago* (last edited 6 months ago) by chraebsli@programming.dev to c/programmer_humor@programming.dev
 

.

 
 

After i joined the Fediverse, i deleted my accounts on Reddit, Twitter & Facebook a few days later. Yesterday, i deleted TikTok too and i will delete Instagram more or less soon. I hope some friends will change to the Fedi until then.

Ive had enough of all the ads and people just want fame. Make Social Media better!

view more: next ›