Learning Journal

Sign multiple commitsgit

git rebase --exec 'git commit --amend --no-edit -n -S' -i

2020/10/15

You can toggle Org-mode links to display the description or the literal syntax wiht org-toggle-link-display. This function is bound to M-SPC m d T in Doom Emacs

Unexpected EOF while reading item 17 of listclojure

2020/10/14 This is a syntax compilation error due to a list without a closing ).

(ns firn.org
  "Functions for managing org-related things.
  Most of these functions are for operating on EDN-fied org-file
  Which are created by the rust binary."
  (:require [clojure.java.shell :as sh]
            [clojure.string :as s]
            [firn.util :as u]
            [cheshire.core :as json]
            ;; [firn.org :as org])

;; Unhandled clojure.lang.ExceptionInfo
;; Unexpected EOF while reading item 17 of list.
;; {:type :reader-exception, :ex-kind :eof}

Nested shorthand anonymous functions are not allowedclojure

2020/10/12

Nested #() are not allowed. I discovered this while solving 4Clojure problem 40, Interpose a seq.

Legal:

((fn
  [sep coll]
  (drop-last (reduce #(conj %1 %2 sep) [] coll))) "and" [1 2 3])

;; =>  (1 "and" 2 "and" 3)

Illegal:

(#(drop-last (reduce #(conj %3 %4 %1) [] %2)) "and" [1 2 3])

;; Caused by clojure.lang.LispReader$ReaderException
;;   java.lang.IllegalStateException: Nested #()s are not allowed

Modify separate keyboards independently on macOSmacos

2020/10/4

For example, if you have mapped caps lock to the escape key on a Macbook Pro keyboard, when you plug in an external Apple keyboard, you have to modify its caps lock key independently.

Responsive widths and heightscss

2020/9/27

Create a responsive element with a maximum width.

.sidebar {
  width: 100%;
  max-width: 25rem;
}

Note: A width must be defined for the max-width to take effect.

Use the prefers-color-scheme media query to detect light or dark modecss

2020/9/25

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: white;
    --color-background: black;
  }
}

Reference: prefers-color-scheme

Reset an initial Git commitgit

2020/9/24

git update-ref -d HEAD

Force Org-publish with prefix argumentemacs

2020/9/24

Force publish all files with Org-publish with prefix argument.

Example: C-c org-publish

Org uses timestamps to track when a file has changed. The above functions normally only publish changed files. You can override this and force publishing of all files by giving a prefix argument to any of the commands above.

Reference: Publishing (Org Mode Compact Guide)