• 5 Posts
  • 42 Comments
Joined 2 years ago
cake
Cake day: June 25th, 2023

help-circle




  • __LINE__ returns the line of code its on, and % 10 means “remainder 10.” Examples:

    1 % 10 == 1
    ...
    8 % 10 == 8
    9 % 10 == 9
    10 % 10 == 0 <-- loops back to 0
    11 % 10 == 1
    12 % 10 == 2
    ...
    19 % 10 == 9
    20 % 10 == 0
    21 % 10 == 1
    

    In code, 0 means false and 1 (and 2, 3, 4, …) means true.

    So, if on line 10, you say:

    int dont_delete_database = true;
    

    then it will expand to:

    int dont_delete_database = ( 10 % 10 );
    // 10 % 10 == 0 which means false
    // database dies...
    

    if you add a line before it, so that the code moves to line 11, then suddenly it works:

    // THIS COMMENT PREVENTS DATABASE FROM DYING
    int dont_delete_database = ( 11 % 10 );
    // 11 % 10 == 1, which means true
    



  • It’s two tools: c and v for copy and paste respectively.

    Say you want to copy an output of a command, say

    grep -i 'abc' file.txt | sed 's/b/d/'

    then you can easily add | c to the end to get:

    grep -i 'abc' file.txt | sed 's/b/d/' | c

    and this will copy to clipboard, specifically for KDE’s clipboard manager, Klipper. If you wanted to see the help text for more ways to copy, you’d run c on its own

    The benefit is the tool won’t break between x11 and wayland, but the downsides are that it’s tied to klipper, and you cant see more clipboard metadata, like mimetypes

    If you only use wayland, i’d recommend using wl-clipboard, and alias c=wl-copy and alias v=wl-paste it’s a better tool, imo.

    Should you still want to use my lil snippet, you will need to create these files yourself, i suggest either in your $HOME/.local/bin/ or /usr/local/bin/. And don’t forget to chmod +x them so they are executable.

    Happy experimenting :)



  • I like this one cause there’s quite a number of ways to interpret it. The first one I saw was the doggy having a big appetite, licking its lips and swallowing its saliva while the spider is losing its mind 🤣

    I found there to be 3 ways to interpret the spider panicking:

    • Attack
    • Frozen in fear
    • Running away

    And for the dog, the swallow could mean

    • Actually eating the spider
    • A hungry, drooling swallow
    • A nervous gulp

    You can mix n match most of these to get new stories :)











  • Been running plasma wayland on my desktop… and I’m glad to say it’s working fine. My GPU is just the intel integrated gpu on my i7 11700. I use two monitors, one is new @165hz, the other is older, prob 60hz. I quite like the mixed refresh rate :) The issues I had before with Wayland aren’t relevant to me right now (but still unfixed). I see myself going full Wayland in Plasma 6


  • No problem haha. I think the Arch Wiki is full of neat little tricks like that, definitely give it a check for other things ^^. In this case I actually learned about it from a high school teacher who ran Arch. I was sarcastically complaining that Arch didn’t update fast enough because the update Discord wanted wasn’t in the repos. So to both help me and play along, my teacher linked the wiki page and said RTFM 🤣



  • Desktop: (Arch) about 2-3 times a month, but used to be 1-2 times a week when I wasn’t working. I also usually update when Discord stops working. Sometimes asap when there’s a security fix. Otherwise i update for cool new stuff or because it’s been a while :P

    Laptop: (Debian) 50/50 chance when Discover says there’s updates available

    Phone: (ios) usually when new emojis are available 💀