• 15 Posts
  • 142 Comments
Joined 1 year ago
cake
Cake day: June 19th, 2023

help-circle
  • Ubuntu is great.

    The company that supports it (Canonical) usually makes an annoying decision that goes against the community’s preferences every 3 years or so, but they always eventually rescind it.

    The last decade of annoying decisions is changing which desktop environment is considered “default”, and a bunch of developers time wasted on an ubuntu for phones which never released.

    Their current “annoying decision” is pushing Snaps which are just a way to package apps. They’re okayish, but they run apps slower than the other standards (Flatpak, Appimage, or just installing through a package manager) and Canonical is in charge of the place where Snaps are downloaded.

    Most people just download Ubuntu, uninstall Snaps then install what they want.

    So yeah, ubuntu is great, the company that supports them usually puts one annoying thing in at a time every few years that the community turns off and ignores.



  • There are some tools/libraries that act as a front-layer over regex.

    They basically follow the same logic as ORMs for databases:

    1. Get rid of the bottom layer to make some hidden footguns harder to trigger
    2. Make the used layer closer to the way the surrounding language is used.

    But there’s no common standard, and it’s always language specific.

    Personally I think using linters is the best option since it will highlight the footguns and recommend simpler regexes. (e.g. Swapping [0-9] for \d)


  • At least once every few days while coding, usually to do one of the following:

    1. Select multiple things in the same file at the same time without needing to click all over the place

      Normally I use multicursor keyboard shortcuts to select what I want and for the trickier scenarios there are also commands to go through selections one at a time so you can skip certain matches to end up with only what you want.

      But sometimes there are too many false matches that you don’t want to select by hand and that’s where regex comes in handy.

      For instance, finding:

      • parent but not apparent, transparent, parentheses, apparently, transparently
      • test but not latest, fastest, testing, greatest, shortest
      • trie but not entries, retries, countries, retrieve
      • http but not https

      … which can be easily done by searching for a word that doesn’t include a letter immediately before or immediately after: e.g. \Wtest\W.

    2. Search for things across all files that come back with too many results that aren’t relevant

      Basically using the same things above.

    3. Finding something I already know makes a pattern. Like finding all years: \d{4}, finding all versions: \d+\.\d+\.\d+, finding random things that a linter may have missed such as two empty lines touching each other: \n\s*\n\s*\n, etc…