sudo apt update
sudo apt install nodejs
sudo apt install npm
- Spacemacs の Markdown Layer https://www.spacemacs.org/layers/+lang/markdown/README.html
- 前提条件
- spacemacsインストール済み
- node.js と npm がインストール済み
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 版. ") |