Speisekarte

Table of Contents

1. Das Virus ist der Teufel

und ist im Oasch daham

2. Hausgemachte Spezialitäten

2.1. Stand for ze Emacs and kneel before ze Stallman

2.2. Simon's toy

2.3. Nix

3. Worth reading

4. LaTeX/Unicode addiction?

5. Cringey

5.3. Yappoccino

5.4. union

A union (or coproduct if you're a chad) is a datastructure with one or more injective functions.
It consists of one or more fields that have their corresponding constructor to inject into the datastructure.
If you are given a union as an input you have to pattern match and return the result accordingly.

6. Emacs Functions

6.1. Buffer and Filename functions

(buffer-file-name)
(expand-file-name "testing.org")
(file-name-base)
(file-name-extension (buffer-file-name))
(file-name-split (buffer-file-name))

6.2. copy

(kill-new (buffer-file-name))

7. Telling the Time

7.1. Info

Look at the elisp time manual for more information

7.2. uptime

Ever typed uptime into your terminal and realised your computer has
been running for more than 12 hours?

You can get the same experience in emacs with the interactive function

(emacs-uptime)

(Normally this command is redundant as it should return the same time as regular uptime)

7.3. time in Emacs

The variable current-time-list specifies the format

7.3.1. Telling the time

(current-time) ;; returns emacs internal structure
(current-time-string) ;; human readable string of the current time

7.3.2. Formatting time

(format-time-string "%Y-%M-%dT:%H:%M:%S") ;; to get an ISO8601 String for example

7.3.3. Emacs' Timestructure

(decode-time) ;; returns time as a list of
;; Seconds Minutes Hours Day Month Year DOW(Day of Week) DST(Daylight saving time) UTCOFF

7.4. Get the week of an iso8601 time string

Conveniently there exists a function called iso8601-parse
that can turn iso8601 strings into the decode-time format.
Now if you want to run encode-time on the output of iso8601-parse
to then supply it as the time to (format-time-string "%U") to get the current week, you'd
need to specify the whole iso8601 time string. Yes: The Year, Month, Day, Hours, Minutes and Seconds because
otherwise iso8601-parse fills unknown values with nil which then encode-time can't parse.
To circumvent this just define the simple function

(defalias 'λ 'lambda)
(defun hsheg/iso8601-better-parse (str)
  (encode-time (mapcar (λ (x) (if (eq x nil) 0 x)) (iso8601-parse str)))
  )

And then you can happily format the time to get the week

(format-time-string "%U" (hsheg/iso8601-better-parse "2024-01-24"))

8. Org Mode, LaTeX and HTLM

9. Emacs

There is no system but GNU, and Linux is one of its kernels.

Date: 2024-01-24

Author: HaskellHegemonie

Created: 2024-07-12 Fri 20:28

Validate