[-] chraebsli@programming.dev 2 points 3 days ago

1st of april

47
submitted 1 week ago* (last edited 1 week ago) by chraebsli@programming.dev to c/programming@programming.dev

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 11 points 2 weeks ago

I'd just import it as TwitterIcon

[-] chraebsli@programming.dev 10 points 2 weeks ago

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.

27
submitted 2 weeks ago by chraebsli@programming.dev to c/linux@lemmy.ml

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!

57
submitted 2 weeks ago by chraebsli@programming.dev to c/linux@lemmy.ml

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 3 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 11 points 1 month 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 201 points 3 months ago
  • PHP is old
  • HTML is NOT A PROGRAMMING LANGUAGE!!!
  • CSS is
    ︎ ︎ ︎ not alig-

︎ ︎ ︎ ned

672

Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
[-] chraebsli@programming.dev 30 points 4 months ago

you forgot linux as an alternative to windows and mac;)

[-] chraebsli@programming.dev 13 points 4 months ago

similar here. im still 'new' to linux but have to use windows for my apprentice. also my father uses windows. so often i have to click a button multiple times, ads, or window not responding, ads, sometimes its slow af. did I already mention ads?

15

I'm searching an android app to mark the locations of multiple parked cars. It should be possible to mark different cars somehow to identify them. It would also be cool if there is a feature to share the location with someone on another devica (like a sync between users, NOT copy of coordinates or link on maps

In other words, I need an app to tag multiple locations on a map. It doesn't require to be designed for parked car locations. The app must have these features:

  • GPS Tracker with map
  • support to tag multiple locations
    • mark them somehow uniquely (like note, category, color, icon, ...) The following features would be nice to have:
  • sync with other devices, for example family
  • history of locations
  • set date/time since location is active (can be timestamp)

I'm ok with paying/ ads or require to self host.

[-] chraebsli@programming.dev 11 points 6 months ago

less really is more with more features. and more IS less with less features

[-] chraebsli@programming.dev 12 points 6 months ago

did you know there is a vim tutor for learning how to vim?

923
Songs about Vim (programming.dev)
submitted 6 months ago* (last edited 6 months ago) by chraebsli@programming.dev to c/programmer_humor@programming.dev

.

1168
Touch a file in Linux (programming.dev)
[-] chraebsli@programming.dev 8 points 7 months ago

Yeah.. todays social media is more a commercial ad platform than social media.

the fediverse is the new 'futuristic' social media since its main goal is to connect people and make social media more social

116

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!

[-] chraebsli@programming.dev 7 points 7 months ago

no, since it first checks if the password is correct. if it is, display error message. if it is corrent and the second time, accept the password (code not in screenshot) but if the password is wrong, it doesnt check if it is the first attempt.

view more: next ›

chraebsli

joined 1 year ago