webdev
WebDev danrot 5 months ago 100%
Finding all HTML tags in a project not being self-closed https://danielrotter.at/2024/04/02/finding-all-html-tags-not-being-self-closed.html

For some refactoring I needed to find all HTMl tags not being self-closed. I decided to use regular expression for that, and this is what I came up with.

1
0
programming Programming git bisect and the importance of a clean history
Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    7 months ago 100%

    I agree that some stuff is easier when not squashing commits, but for the teams I've been working with I've felt that the pros of squashing outweigh the cons, but of course YMMV.

    But I didn't know about git bisect skip, thanks for the tip! But sincere question: What happens if there are e.g. three adjacent broken commits? If I have skip all three of those and the error was introduced in one of them, then git cannot tell me which commit introduced the error, right?

    1
  • programming Programming git bisect and the importance of a clean history
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    7 months ago 100%

    I swear, I didn't come up with that myself, I read that somewhere else, but of course I don't have a source anymore 🙈 Maybe some git developer is a huge fan of wordplays?

    2
  • programming
    Programming danrot 8 months ago 100%
    git bisect and the importance of a clean history https://danielrotter.at/2023/10/28/git-bisect-and-the-importance-of-a-clean-history.html

    The value of a clean git history is often underestimated. I will explain one of the advantages based on the git bisect command.

    2
    5
    programming
    Programming danrot 8 months ago 100%
    Avoid mocking repositories by using in-memory implementations https://danielrotter.at/2023/09/22/avoid-mocking-repositories-by-using-in-memory-implementations.html

    Mocking libraries come with disadvantages, but fortunately they can be replaced by in-memory implementations, at least for repositories.

    1
    0
    webdev
    WebDev danrot 9 months ago 100%
    API Design-First vs Code First apisyouwonthate.com

    With API descriptions rising in popularity, the main question I hear folks asking about is "API Design-first" or "code-first". This is a bit of a misleading question because these are not two unique things, there are a few variants. Code-First, Write Docs "When We Have Time" This is how I

    1
    0
    programming
    Programming danrot 9 months ago 100%
    Upgrading GitHub.com to MySQL 8.0 github.blog

    GitHub uses MySQL to store vast amounts of relational data. This is the story of how we seamlessly upgraded our production fleet to MySQL 8.0.

    1
    0
    linux
    Linux danrot 9 months ago 100%
    Making the shell history more useful by using shell variables https://danielrotter.at/2023/09/02/making-the-shell-history-more-useful-by-using-shell-variables.html

    The shell history is cluttered with useless commands if stuff like tokens are included. Shell variables allow to exclude such content from the history.

    3
    0
    webdev
    WebDev danrot 10 months ago 100%
    Combine jq with curl to improve its JSON handling https://danielrotter.at/2023/07/19/combine-jq-with-curl-to-improve-its-json-handling.html

    jq is a nice JSON processor, which is helpful when working with JSON outputs, no matter if they are retrieved using curl or any other command.

    1
    0
    neovim
    Neovim danrot 10 months ago 100%
    Use external programs like git in Neovim commands https://danielrotter.at/2023/07/06/use-external-programs-like-git-in-Neovim-commands.html

    Neovim comes with a very powerful command system, which can even be combined with existing shell commands!

    3
    0
    php
    PHP danrot 10 months ago 100%
    Configuring nginx with php-fpm in kubernetes and the “File not found.” error https://danielrotter.at/2023/05/30/configuring-nginx-with-php-fpm-in-kubernetes-and-the-file-not-found-error.html

    It was not trivial to setup nginx with php-fpm to run in separate containers in kubernetes. Therefore I want to explain how I got it to work.

    3
    0
    javascript
    JavaScript danrot 10 months ago 100%
    Some reasons for disliking react hooks https://danielrotter.at/2022/01/16/some-reasons-for-disliking-react-hooks.html

    React has introduced hooks to replace classes. Some people are huge fans, while I am a bit more skeptical. An explanation.

    1
    0
    webdev
    WebDev danrot 10 months ago 100%
    Use git submodules and make for simple code sharing https://danielrotter.at/2021/03/06/use-git-submodules-and-make-for-simple-code-sharing.html

    Simple code often does not require complicated packaging mechanisms. Reusing established tools like Git and make seem perfect for this use case.

    1
    0
    programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    I think this is one of the most common misconceptions about DRY. Just because you have two times the same line in your code base it is not automatically a violation of DRY. If you compare if a number is bigger than 18 it is definitely not a good idea to extract that part if you are comparing the hour of the day once and the age the other time. In that case it would even be bad to create an abstration, and it would not be a violation of DRY. And I agree that something like this leads to code that is hard to maintain.

    1
  • programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    I have also seen well commented code, but in this article I concentrate on the bad ones. Are you saying you have never seen a bad code comment?

    1
  • programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 0%

    I think this is also in line with my article, since not being able to put yourself into somebody else's shoes (or even in yourself future's ones) is the reason for so much bad comments. But adding a comment to every single line cannot be the solution either, at least not in a higher programming language.

    0
  • programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    I agree with almost all of what you say, but the thing IME is that in most cases people learn to comment a lot, which results in comments that feel like they've been done just for the sake of it, which is one of the main problems IMO. It's not like "just add a comment, it won't hurt", since comments can be immensely misleading and literally take a lot of time until figuring out that the comment was wrong if you trust the wrong ones.

    I also agree that this tends to be worse with bad code, which also is not surprising. Sometimes it feels to me like people think they can fix bad code with some comments, and I think that is far from being true.

    I also admit that especially the title of the article might be a bit provocative, but giving the general positive sentiment of comments I think this is called for. Sometimes you have to exaggerate a bit to get some attention. I don't like click-baiting either, but unfortunately it works ;-)

    1
  • programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    I give you that, but I am not talking about assembly languages, therefore the examples from my blogpost aren't showing any :-)

    1
  • programming Programming Code comments are (mostly) a violation of DRY
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    Totally agree, that's why I also mentioned this in the article.

    Very often good code that is self-explanatory does not need any comments at all and if it does, the comment should describe why it has been implemented this way instead of just repeating what the code already says.

    1
  • programming
    Programming danrot 10 months ago 100%
    Code comments are (mostly) a violation of DRY https://danielrotter.at/2021/01/16/code-comments-are-mostly-a-violation-of-dry.html

    Comments in code are quite often a code smell. Let’s see what is suboptimal about comments and talk about some strategies to avoid them.

    2
    17
    linux Linux Automatic command execution on file changes with entr
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    Ah, you are talking about systemd, wasn't aware of that... I imagine that to be much more complicated for many use cases. E.g. running a unit test (as I describe in the article) isn't something I would use systemd for. Setting up a path and a service seems more complicated than using entr, and it is probably also harder to get to the output as well.

    1
  • linux Linux Automatic command execution on file changes with entr
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    10 months ago 100%

    I am not exactly sure what you mean by that... But the main advantage is that the command does not have to be executed manually everytime you change something. Instead entr recognizes when something changes and re-executes the command for you.

    1
  • linux
    Linux danrot 10 months ago 100%
    Automatic command execution on file changes with entr https://danielrotter.at/2020/10/07/automatic-command-execution-on-file-changes-with-entr.html

    Sometimes you want a command to be automatically executed as soon as a certain file changes. There is a small tool called entr, which helps with that.

    1
    4
    Symfony
    symfony danrot 10 months ago 100%
    Applying design patterns: The builder and factory pattern in a DI context https://danielrotter.at/2020/08/24/applying-design-patterns-the-builder-and-factory-pattern.html

    Creating objects is a very basic task. Although this seems like a simple problem, it can be improved by using patterns like builder and factory.

    4
    0
    linux Linux Execute commands for multiple files using fish
    Jump
    webdev
    WebDev danrot 11 months ago 100%
    Web Push Book web-push-book.gauntface.com

    Web push book provides all the information you need to learn about the web push API.

    3
    0
    webdev
    WebDev danrot 11 months ago 100%
    Understanding animated graphs in D3.js https://danielrotter.at/2020/06/12/understanding-animated-graphs-with-d3js.html

    Building a graph is a pretty straight forward task in D3.js, but I’ve had a hard time understanding how to update them. This is a try to explain why.

    1
    0
    linux Linux Execute commands for multiple files using fish
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    11 months ago 100%

    That's true, but the syntax is different then. In this blog post I cover fish, and I didn't intent to say that this cannot be done in other shells (and I think I never said so).

    1
  • linux
    Linux danrot 11 months ago 100%
    Execute commands for multiple files using fish https://danielrotter.at/2020/05/13/execute-commands-for-multiple-files-in-fish.html

    Quite often I want to execute the same command for multiple files. It is quite easy to achieve that using the fish shell, once you get the hang of it.

    4
    6
    webdev WebDev It's 2023, here is why your web design sucks.
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    11 months ago 100%

    Sure, web applications have different requirements and might warrant the use of more JavaScript than a website does. But one of the biggest problems nowadays IMO is that many developers choose these fancy technologies also for websites, just because they like them, without thinking too much about how that affects the user, and it does so in a mostly negative way. If you are building a website for the local bakery HTML and CSS backed by any CMS probably suffice, and there is no need to add the complexity of client-side JavaScript and SSR (or whatever) to it.

    1
  • webdev WebDev It's 2023, here is why your web design sucks.
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    11 months ago 100%

    I think the point of the article (and I agree to that) is that "modern" websites (i.e. use heavy javascript frameworks) are having real issues that websites being built without loads of client-side javascript do not have. I guess some websites built in 2005 are performing better and are more accessible than websites being built today.

    4
  • webdev
    WebDev danrot 11 months ago 100%
    It's 2023, here is why your web design sucks. heather-buchel.com

    Exploring the reasons why we no longer have web designers.

    7
    8
    programming
    Programming danrot 11 months ago 100%
    Keep All Commits Green kellysutton.com

    The practice of keeping all commits green can help create better software faster. Let’s explore why.

    3
    0
    programming
    Programming danrot 11 months ago 100%
    Demystifying Containers - Part I: Kernel Space https://medium.com/@saschagrunert/demystifying-containers-part-i-kernel-space-2c53d6979504

    This series of blog posts and corresponding talks aims to provide you with a pragmatic view on containers from a historic perspective. Together we will discover modern cloud architectures layer by…

    3
    0
    linux
    Linux danrot 11 months ago 100%
    Finding used values of XML attributes using the command line https://danielrotter.at/2020/04/14/finding-used-values-of-xml-attributes-using-the-commandline.html

    I was refactoring a feature and wanted to know which options were used for a certain attribute in a XML file. I decided to level up my CLI skills for that.

    2
    0
    webdev
    WebDev danrot 11 months ago 100%
    Writing a TodoMVC App With Modern Vanilla JavaScript frontendmasters.com

    Click here to see how I turned \~170 lines of code in moder vanilla JavaScript in TodoMVC.

    3
    0
    webdev WebDev Avoid z-indexes whenever possible
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    11 months ago 100%

    I have even mentioned stacking contexts in the article, and the thing is that they are not only introduce with z-index, which makes them even more complex :-/ So yeah, it certainly helps if you understand them, but I think it does not make the problem less complex.

    1
  • webdev
    WebDev danrot 12 months ago 100%
    Avoid z-indexes whenever possible https://danielrotter.at/2020/04/08/avoid-z-index-whenever-possible.html

    Whenever I use z-indexes, I am going to regret it at some point, especially with libraries utilizing components. Let’s see if we can avoid them all together.

    3
    2
    webdev
    WebDev danrot 12 months ago 75%
    Stick to boring architecture for as long as possible addyosmani.com

    "Stick to boring architecture for as long as possible, and spend the majority of your time, and resources, building something your customers are willing...

    2
    0
    webdev
    WebDev danrot 12 months ago 100%
    Classic rock, Mario Kart, and why we can't agree on Tailwind joshcollinsworth.com

    It's popular to say we can’t agree on Tailwind, but I posit we actually already do. I think what we actually disagree on isn’t the details of this (or any) specific software; it's in what we value, and how we each define assets and liabilities.

    5
    0
    webdev WebDev Tailwind, and the death of web craftsmanship
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDA
    danrot
    12 months ago 100%

    I mean it is not really inline styles, with inline styles only it is e.g. not possible to implement a hover style AFAIK. I think the inventor has written a blog post explaining the steps, is that what you are referring to? I also read that, and it kinda makes sense, but basically giving up on development tools to work properly is kind of a high trade IMO.

    I would also be interested in seeing a performance benchmark. As the article says, gzip will probably make the difference in terms of network traffic negligible, but it would be interesting to see the impact it has on parsing HTML.

    1
  • webdev
    WebDev danrot 1 year ago 100%
    Tailwind, and the death of web craftsmanship https://pdx.su/blog/2023-07-26-tailwind-and-the-death-of-craftsmanship/

    There's a worrying trend in modern web development, where developers are throwing away decades of carefully wrought systems for a bit of perceived convenience. Tools such as Tailwind CSS seem to be spreading like wildfire, with very few people ever willing to acknowledge the regression they bring to our field. And I'm getting tired of it

    4
    2
    webdev
    WebDev danrot 1 year ago 100%
    Creating highly customizable HTML presentations with markdown and pandoc https://danielrotter.at/2020/03/28/creating-highly-customizable-html-presentation-with-markdown-and-pandoc.html

    Presentations can be created using markdown, a plain file format. There are some available options, but let’s see why it pays off to build your own solution.

    2
    0