yadm add [filename]
yadm commit
yadm push -u origin master
#!/usr/bin/env bb | |
(require '[clojure.java.shell :refer [sh]] | |
'[clojure.string :as string]) | |
(def default-file "highlights.org") | |
;; (def test-text | |
;; "プリズム──本来の名称である「プラガ世界間通信機器」の頭字語をもじった呼び名──には、赤と青のLEDが一個ずつついている。 | |
;; テッド チャン. 息吹 (Japanese Edition) (Kindle の位置No.4816-4818). Kindle 版. ") |
(defun quick-look-dwim() | |
(interactive) | |
(call-process-shell-command | |
(format "qlmanage %s -p &>/dev/null" | |
(treemacs--nearest-path (treemacs-current-button))) | |
nil 0)) | |
(with-eval-after-load "treemacs" | |
(define-key treemacs-mode-map (kbd "SPC") 'quick-look-dwim)) |
(def dt-a (js/Date. "2020-05-01")) | |
(def dt-b (js/Date. "2020-05-30")) | |
(def mills<->days (* 1000 60 60 24)) | |
(defn get-duration | |
"2つの日付の差分(日数)を求める" | |
[dt-a dt-b] | |
(/ (- dt-b dt-a) mills<->days)) | |
(get-duration dt-a dt-b) ;-> 29 |
;; N-gram | |
(defn n-gram-index | |
"N-gram インデックスの作成" | |
[n s] | |
(map clojure.string/join (partition n 1 s))) | |
(def trigram-index (partial n-gram-index 3)) | |
;; 2つの日付の差分(日数)を取得 | |
(def dt-a #inst "2020-05-01") |