Just a geek, finding my way in the fediverse.

  • 0 Posts
  • 101 Comments
Joined 3 years ago
cake
Cake day: June 11th, 2023

help-circle



  • I’d never heard of MX or AntiX so I just snagged those, thanks for seeding.

    It also reminded me that I hadn’t been seeding for a long time so I left those seeding. I also snagged the torrents for my main flavors (Debian, Mint), got the latest versions, and left those seeding too. Thanks for the reminder!

    Debian 13 is 3.71GB, Mint is 2.8GB.

    I haven’t used CachyOS much but I sometimes recommend it to noobs since it looks “slick” by default and (I think) typically has good GPU support. I went ahead and grabbed that one too, just to have it around, and it’s 2.83GB. Currently seeding as well.

    While it’s over your 4GB limit @ 4.4GB, I pulled+seeded the latest Kali as well. Also nice to have that one around when it’s needed. The USB drive I carry around with it is probably 5 years old so I should probably update that anyway : )

















  • The two biggest things I use it for are programmatically generating “lists of lists” (lists of pages, more accurately) and as a semi-hacky way to get text colors. Semi-related, the “Treeview” plugin gives you a folder hierarchy panel off to the left (by default) which is really, really nice.

    I should probably clarify that I didn’t write these, I stole them from the Silverbullet community forums… also I should reiterate that I suck at Lua so take my explanations with a grain of “this person may not know what they’re talking about” ; )

    Lists of Lists : I have a bad memory so I create a LOT of lists. I even have a base page named “Lists” that I then nest different types of lists under (TODOs for home, for work, for school, for projects, for selfhosting, etc). Since the table is programmatically generated, it’s always up to date on each load. This first snippet relies on using frontmatter on the respective pages along with the tags property.

    ${query[[
    from index.tag "todolist"
    order by lastModified desc
    select {
      List="[[" .. _.name .. "]]",
      Modified=_.lastModified
      }
    ]]}
    

    This retrieves all pages from the space index with a tag of todolist (from the frontmatter), orders them by lastModified, descending, and renders a table that contains the name and lastModified date. This is excellent for providing a list of pages (based on tag, todolist in this case) related to a topic and ordering them by the last time they were changed. I use this in the base page for pretty much all of my “folders”. Screenshot :

    Text Color Hack : Since the Silverbullet markdown interpreter doesn’t (currently) support plain HTML, and the way we usually color specific areas of text within Markdown is <span style="color: #fff">white text</span>, they had to get inventive. Somebody came up with a way to provide Lua functions that will accept text as a parameter and then render it with the specified HTML color/style.

    In my CONFIG page (that is applied to the entire space) I included a space-lua code block like :

    function Red(text)
      return widget.html(dom.span {
        style="color:#e60000; font-weight: bold;",
        text
      })
    end
    // Also about 5 more for different colors I use, snipped for simplicity.
    

    Then, anywhere in my Silverbullet space I can use a Lua code snippet like The following word is ${Red("red")} and it will invoke the space-lua function named Red() on the text red, apply the styling, and render it with CSS color #e60000. Hacky? Yeah… but it works for now. Screenshot :

    … I’ve been meaning to build a generic Colorize(text, hexColor) function (which would likely take all of 30 seconds : ) but haven’t yet. Maybe tonight.

    EDIT: That did, in fact, take 30 seconds. Function :

    // This assume "color" parameter is a valid/properly formatted CSS color, meaning a known word ("red"), hex ("#ff0000"), or presumably RGB/etc but so far I've only tested color names and hex (I typically use hex)
    function Colorize(text, color)
    return widget.html(dom.span {
        style=string.format("color:%s; font-weight: bold;", color),
        text
      })
    end
    

    Usage : ${Colorize("any text", "#00ff00")}