kaka.farm

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4a2c05f57a81b04ea3f50ceebae9c4ea59b8e702
parent cb04653deb5e29f5bfb2560b5ed2b8548ebd614b
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Fri, 22 Dec 2023 03:38:21 +0200

Add haunt stuff and a gitignore.

Diffstat:
A.gitignore | 2++
Ahaunt.scm | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Ahaunt/images/logo.png | 0
Ahaunt/kakafarm/weechatlog.scm | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aposts/you-know-what-i-hate.sxml | 192+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 308 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,2 @@ +*~ +*# diff --git a/haunt.scm b/haunt.scm @@ -0,0 +1,53 @@ +(import (ice-9 pretty-print) + (sxml simple) + (haunt artifact) + (haunt asset) + (haunt builder assets) + (haunt builder atom) + (haunt builder blog) + (haunt builder rss) + (haunt html) + (haunt post) + (haunt reader commonmark) + (haunt reader skribe) + (haunt reader) + (haunt site) + (haunt kakafarm weechatlog)) + +(define (pp attribute record) + (pretty-print (list attribute (attribute record)))) + +(define (post->sxml-link post) + `(li (a (@ (href ,(post-file-name post))) + ,(date->string* (post-date post))))) + +(define* (builder-experiment destination) + (lambda (site posts) + (serialized-artifact + destination + `(html (head) + (body (h1 "Kakafarm's Haunt") + (h2 "Latest posts:") + (div (@ (class "latest-posts")) + (ul ,(map post->sxml-link posts))) + (p (a (@ (href "/haunt/posts/")) + "posts")) + (p (a (@ (href "/haunt/feed.xml")) + "atom feed")))) + sxml->html))) + +(site #:title "kaka.farm - Haunt site" + #:domain "kaka.farm" + #:default-metadata '((author . "Yuval Langer") + (email . "yuval.langer@gmail.com")) + #:readers (list commonmark-reader + sxml-reader) + #:builders (list (blog #:prefix "/haunt/posts") + (builder-experiment "/haunt/index.html") + (atom-feed #:file-name "/haunt/feed.xml" + #:blog-prefix "/haunt/posts") + (atom-feeds-by-tag #:prefix "/haunt/feeds" + #:blog-prefix "/haunt/feeds/") + (static-directory "kaka.farm" "/") + (static-directory "haunt/assets" "haunt/assets") + (static-directory "haunt/images" "haunt/images"))) diff --git a/haunt/images/logo.png b/haunt/images/logo.png Binary files differ. diff --git a/haunt/kakafarm/weechatlog.scm b/haunt/kakafarm/weechatlog.scm @@ -0,0 +1,61 @@ +(define-library (haunt kakafarm weechatlog) + (import (scheme base) + (srfi :9) + (srfi :19) + (ice-9 match) + (ice-9 peg)) + (export parse-weechatlog + weechatlog-line? + weechatlog-datetime + weechatlog-user-status + weechatlog-nickname + weechatlog-message) + + (begin + (define-record-type <weechatlog-line> + (make-weechatlog-line datetime + user-status + nickname + message) + weechatlog-line? + (datetime weechatlog-datetime) + (user-status weechatlog-user-status) + (nickname weechatlog-nickname) + (message weechatlog-message)) + + (define-peg-string-patterns + "weechatlog <-- (NL* weechatlog-line)* NL* +weechatlog-line <-- datetime-field T BRA user-status nickname-field KET T message-field +datetime-field <-- (!NL !T .)* +nickname-field <-- (!NL !T !KET .)* +message-field <-- (!NL .)* +user-status <-- (.) +BRA < '<' +KET < '>' +T < '\t' +NL < '\n'") + + + (define (parse-datetime str) + (string->date str "~Y-~m-~dT~H:~M:~S~z")) + + (define (parse-weechatlog str) + (let ((tree (peg:tree (match-pattern weechatlog str)))) + (match tree + (`(weechatlog + . ,weechatlog-lines) + (map parse-weechatlog-line + weechatlog-lines)) + (else + (error "Bad weechatlog:" tree))))) + + (define (parse-weechatlog-line tree) + (match tree + (`(weechatlog-line (datetime-field ,datetime-field) + (user-status ,user-status) + (nickname-field ,nickname-field) + (message-field ,message-field)) + (make-weechatlog-line (parse-datetime datetime-field) + user-status + nickname-field + message-field)))))) diff --git a/posts/you-know-what-i-hate.sxml b/posts/you-know-what-i-hate.sxml @@ -0,0 +1,192 @@ +(import (srfi :9) + (srfi :19) + (ice-9 pretty-print) + (ice-9 match) + (haunt utils) + (haunt kakafarm weechatlog)) + +(define-record-type <hate> + (make-hate title logs-or-paragraphs) + hate? + (title hate-title) + (logs-or-paragraphs hate-logs-or-paragraphs)) + +(define-record-type <log> + (%make-log server channel weechatlog) + log? + (server log-server) + (channel log-channel) + (weechatlog log-weechatlog)) + +(define (make-log server channel weechatlog-index) + (%make-log server channel (list-ref weechatlogs weechatlog-index))) + +(define-record-type <paragraph> + (make-paragraph text) + paragraph? + (text paragraph-text)) + +(define (paragraph->sxml paragraph) + `(div (@ (class "paragraph")) + (p ,(paragraph-text paragraph)))) + +(define (log->sxml log) + `(div (@ (class "log")) + (p ,(string-append (log-channel log) + " @ " + (log-server log))) + (pre ,(map (lambda (line) + (string-append + (date->string (weechatlog-datetime line) "~4") + "\t<" + (weechatlog-user-status line) + (weechatlog-nickname line) + ">\t" + (weechatlog-message line) + "\n" + )) + (log-weechatlog log))))) + +(define (log-or-paragraph->sxml log-or-paragraph) + (match log-or-paragraph + ((? log? log) + (log->sxml log)) + ((? paragraph? paragraph) + (paragraph->sxml paragraph)))) + +(define (hate->sxml hate) + `(div (@ (class "hate")) + (h2 ,(hate-title hate)) + (div ,(map log-or-paragraph->sxml + (hate-logs-or-paragraphs hate))))) + +(define weechatlogs + (map parse-weechatlog + '("2021-08-27T14:48:14+0000 < cow_2001> You know what I hate? +2021-08-27T14:48:48+0000 < cow_2001> People who shout while sneezing. I hate them." + "2021-08-27T15:48:44+0000 < cow_2001> !ud perused +2021-08-27T15:48:45+0000 < e-bot1> perused(1/7): To examine or study. +2021-08-27T15:48:50+0000 < cow_2001> !ud 2 +2021-08-27T15:48:50+0000 < e-bot1> perused(2/7): The act of a person or small group of people travelling somewhere, often by foot, without a distinct purpose other than having fun. +2021-08-27T15:48:51+0000 < cow_2001> !ud 3 +2021-08-27T15:48:52+0000 < e-bot1> perused(3/7): One of the most overused words in modern english. Typically used by snobs trying to sound more intelligent than they really are. It simply means to review, usually with great care. +2021-08-27T15:48:52+0000 < cow_2001> !ud 4 +2021-08-27T15:48:53+0000 < cow_2001> !ud 5 +2021-08-27T15:48:54+0000 < cow_2001> !ud 6 +2021-08-27T15:48:54+0000 < e-bot1> perused(4/7): what you're doing to this definition +2021-08-27T15:48:55+0000 < cow_2001> !ud 7 +2021-08-27T15:48:56+0000 < e-bot1> perused(5/7): Going to Peru and crusing around. +2021-08-27T15:48:58+0000 < cow_2001> huh +2021-08-27T15:48:58+0000 < e-bot1> perused(6/7): To carefully examine a young woman's booty but quick enough as to not get caught. +2021-08-27T15:49:00+0000 < e-bot1> perused(7/7): A verb describing the act of perusing in a future tense. +2021-08-27T15:50:45+0000 < cow_2001> You know what I hate? +2021-08-27T15:51:10+0000 < cow_2001> People who flood in chat rooms with various bots. I hate them. +2021-08-27T15:51:32+0000 < cow_2001> who +2021-08-27T15:51:33+0000 < cow_2001> what +2021-08-27T15:57:49+0000 < someone-0> :D +2021-08-27T15:50:45+0000 < cow_2001> You know what I hate? +2021-08-27T15:51:10+0000 < cow_2001> People who flood in chat rooms with various bots. I hate them. +2021-08-27T15:57:49+0000 < someone-0> :D" + "2022-08-15T07:30:55+0000 < cow_2001> you know what i hate about Gnome? they hide the names of their executables." + "2022-08-27T22:03:38+0000 < cow_2001> you know what i hate in phones? +2022-08-27T22:04:08+0000 < cow_2001> when the whole screen is filled with configuration buttons and you are scrolling down and afraid you would flip a switch in the configuration by accident" + "2022-09-07T12:08:51+0000 < cow_2001> i just discovered something horrid! neovim's gqq wrap command depends on the size of your terminal!" + "2022-11-24T14:08:29+0000 < cow_2001> there're a thousand different streaming services +2022-11-24T14:08:38+0000 < cow_2001> but not one is a screaming service" + "2022-11-24T15:33:13+0000 < cow_2001> you know what i hate? you press a radio button form widget and you want to scroll down. you press the down arrow. now the radio button chosen is the next radio button to the one you actually want to choose." + "2022-11-24T15:33:23+0000 < cow_2001> you know what i hate? you press a radio button form widget and you want to scroll down. you press the down arrow. now the radio button chosen is the next radio button to the one you actually want to choose." + "2023-01-19T04:38:29+0000 < cow_2001> you know what i hate? sometimes things expect \"yes\" sometimes things expect \"y\". if you write \"yes\" to something that expects \"y\" you write \"es\" for no good reason. +2023-01-19T04:39:35+0000 < cow_2001> \"no\" is only half as chaotic as \"yes\"… +2023-01-19T04:40:19+0000 < cow_2001> (i just did it when upgrading stuff in package-list-packages) +2023-01-19T04:40:39+0000 < cow_2001> meobutingoodmood: :D" + "2023-01-30T23:23:29+0000 < cow_2001> you know what i hate? when some program steals my keyboard focus or displays on top of another out of nowhere" + "2023-01-30T23:33:12+0000 < cow_2001> you know what i hate? when some program steals my keyboard focus or displays on top of another out of nowhere. +2023-01-30T23:33:24+0000 < someone-1> cow_2001 that gotta be GNOME." + "2023-03-03T07:16:59+0000 < cow_2001> you know what i hate? when you go around wikipedia and hover your mouse over a link, it pops up an obnoxious intrusive popup window with the link's article showing up" + "2023-11-09T14:01:19+0000 < cow_2001> you know what i hate? i hate it when i point at something a wee popup appears and it just won't disappear, stopping me from either seeing or clicking anything it hides. I HATE IT. they can appear when i am just pgdning and pguping around the page and the cursor is just hanging out there minding its own business." + "2023-11-09T13:59:49+0000 < cow_2001> you know what i hate? i hate it when i point at something a wee popup appears and it just won't disappear, stopping me from either seeing or clicking anything it hides. +2023-11-09T13:59:57+0000 < cow_2001> I HATE IT. +2023-11-09T14:00:41+0000 < cow_2001> they can appear when i am just pgdning and pguping around the page and the cursor is just hanging out there minding its own business." + "2023-11-09T14:01:27+0000 < cow_2001> you know what i hate? i hate it when i point at something a wee popup appears and it just won't disappear, stopping me from either seeing or clicking anything it hides. I HATE IT. they can appear when i am just pgdning and pguping around the page and the cursor is just hanging out there minding its own business. +2023-11-09T14:03:42+0000 <@someone-2> sounds like a virus +2023-11-09T14:08:44+0000 < cow_2001> no, just bad ui design" + "2023-04-01T14:06:16+0000 < cow_2001> you know what i hate? you write \"info sigaction\" but it gives you the crummy manpage +2023-04-01T14:06:36+0000 < someone-3> because its not man its info ya dink +2023-04-01T14:06:41+0000 < cow_2001> someone-3: it'll go right over my head :( +2023-04-01T14:07:05+0000 < someone-3> theres a vim plug to put into pages ina more reasonable format +2023-04-01T14:07:14+0000 < someone-3> forget the name" + "2023-04-06T13:13:09+0000 < cow_2001> you know what i hate? DRMed board games" + "2023-05-04T21:34:32+0000 < cow_2001> you know what i hate? documentation that has only the keybindings, not the interactive function names +2023-05-04T21:34:49+0000 < someone-4> for which package? +2023-05-04T21:34:53+0000 < cow_2001> <_< +2023-05-04T21:35:09+0000 < cow_2001> i don't want to sound mean spirited" + "2023-09-09T13:26:24+0000 < cow_2001> someone: You know what I hate? +2023-09-09T13:26:32+0000 < cow_2001> someone: Long sentences." + "2023-09-10T12:26:32+0000 < cow_2001> You know what I hate? +2023-09-10T12:26:54+0000 < someone-5> allcaps? +2023-09-10T12:27:28+0000 < cow_2001> Going to some Activitypub site with EWW and finding out I need to run Javascript in order to read it. Hokum, humbug, and bah." + "2023-12-14T17:32:47+0000 < cow_2001> you know what i hate? mastodon't's mandatory javascript +2023-12-14T17:33:01+0000 < cow_2001> mandatory is a word i keep forgetting" + "2023-11-09T11:12:37+0000 < someone-6> 947 color themes to choose from and not 1 is decent" + "2023-12-12T00:23:45+0000 < cow_2001> you know what i hate? when a dark mode site loads, just before the css loads, it is a blaring white page" + "2023-12-12T00:23:51+0000 <@cow_2001> you know what i hate? when a dark mode site loads, just before the css loads, it is a blaring white page +2023-12-12T00:24:09+0000 <@cow_2001> it happens with dumb web based desktop programs"))) + +(define hates + (list + (make-hate "Loud sneezers:" + (list (make-log "libera" "#israel" 0))) + (make-hate "Definition bot flooders:" + (list (make-log "libera" "#israel" 1) + (make-paragraph "(I do it a lot myself)"))) + (make-hate "Gnome hiding executable names:" + (list (make-log "libera" "##politics" 2))) + (make-hate "Touch screen configuration scrolling:" + (list (make-log "nerds" "#nerds" 3))) + (make-hate "NeoVim's gqq wrap command depends on terminal width:" + (list (make-log "libera" "#israel" 4))) + (make-hate "They nerfed U+1F52B PISTOL 🔫:" + (list (make-paragraph "2023-12-14 - The Unicode Consortium (or whatever) nerfed the pistol and replaced it with a water gun."))) + (make-hate "No screaming services:" + (list (make-log "libera" "#israel" 5) + (make-paragraph "2023-12-15 - I was informed, though, that there is a server called ShoutCast for Internet broadcast."))) + (make-hate "Keyboard scrolling in a configuration page changes the configuration:" + (list (make-log "libera" "#israel" 6) + (make-log "efnet" "#israel" 7))) + (make-hate "Eager confirmation menus:" + (list (make-log "libera" "#emacs" 8))) + (make-hate "Input focus stealing programs:" + (list (make-log "libera" "#israel" 9) + (make-log "libera" "#emacs" 10))) + (make-hate "Popup menues triggered by an unused mouse cursor hover:" + (list (make-log "libera" "#israel" 11) + (make-log "quakenet" "#israel" 12) + (make-log "libera" "#systemcrafters" 13) + (make-log "efnet" "#israel" 14))) + (make-hate "info giving you a crummy manpage instead of a glorious reference manual:" + (list (make-log "libera" "#libera-discord" 15))) + (make-hate "Single use board games (stickers and scratch cards):" + (list (make-log "libera" "#scheme" 16))) + (make-hate "Emacs documentation without function names, only keybindings:" + (list (make-log "libera" "#emacs" 17))) + (make-hate "https://www.youtube.com/watch?v=gXB84fpWzg8&t=64s, but for text:" + (list (make-log "libera" "#israel" 18))) + (make-hate "Not allcaps, mandatory Javascript:" + (list (make-log "libera" "#emacs" 19) + (make-log "libera" "#systemcrafters" 19))) + (make-hate "Not mine, color themes, not one decent:" + (list (make-log "efnet" "#israel" 20))) + (make-hate "Dark mode loaded only after a flash of blinding light:" + (list (make-log "libera" "systemcrafters" 21) + (make-log "quakenet" "#israel" 22))))) + +(define the-post + `((title . "You know what I hate?") + (date . ,(string->date* "2023-12-15 00:00")) + (tags "rants") + (summary . "Things I hate.") + (content + ((h1 "Things I hate.") + ,(map hate->sxml hates))))) + +the-post