-- Leo's gemini proxy

-- Connecting to idiomdrottning.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

lspls


Creating zshbrev kinda stopped my releasing of apps into a halt because now instead of making a whole app I’ll just add a few lines to .zshbrev/functions.scm, usually hardcoding paths and variables too just because that’s simpler.


Like right now, I wanted a simple CLI app to turn a shell glob into a .pls playlist so I just:


(define (lspls . files)
  (print "[playlist]
NumberOfEntries=" (length files))
  ((over (print "File" (add1 i) "=" x))
   (map
    (strse "/var/example/path1"
           "https://example.url/prefix1"
           "/var/example/path2"
           "https://example.url/prefix2")
    (map realpath files)))
  (void))

(Using my real file paths and URL prefixes instead of those example ones.)


Zshbrev too good! The Emacs-inspired whole “big ball of spaghetti” approach where any function can call any other function—like “realpath” in this example, originally defined for something else—turned out to be quite the ticket for code reuse.


zshbrev

-- Response ended

-- Page fetched on Fri May 17 10:50:36 2024