changeset 2: |
a4e233714062 |
parent 1: |
d119ae1ce0d5 |
child 3: |
04bd01442fcd |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Mon, 12 Aug 2024 18:31:37 -0400 |
files: |
acronyms.org babel.org glossary.org mindset.org pitch.org readme.org style.org tech.org terms.org workflows.org |
description: |
meta and task updates |
1.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2+++ b/acronyms.org Mon Aug 12 18:31:37 2024 -0400
1.3@@ -0,0 +1,6 @@
1.4+#+title: acronyms
1.5+#+author: Richard Westhaver
1.6+#+description: CC Acronyms
1.7+#+setupfile: ../clean.theme
1.8+#+glossary_sources: terms
1.9+#+print_glossary:
2.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2+++ b/babel.org Mon Aug 12 18:31:37 2024 -0400
2.3@@ -0,0 +1,336 @@
2.4+#+title: babel
2.5+#+author: Richard Westhaver
2.6+#+description: Core Library of Babel
2.7+#+setupfile: ../clean.theme
2.8+#+property: header-args :exports both
2.9+Welcome to the Core [[https://www.gnu.org/software/emacs/manual/html_node/org/Library-of-Babel.html][Library of Babel]]. This file contains a
2.10+collection of code blocks used throughout our Org documents.
2.11+
2.12+To load the library use ~C-c C-v i~.
2.13+
2.14+* systemd-list-units :os:
2.15+:PROPERTIES:
2.16+:ID: 3b23c98d-a286-4988-846d-2dab3d25803d
2.17+:END:
2.18+#+name: systemd-list-units
2.19+#+begin_src sh :results replace
2.20+systemctl list-units --state=running | grep -v systemd | awk '{print $1}' | grep service
2.21+#+end_src
2.22+
2.23+* wc-dir-lines :fs:
2.24+:PROPERTIES:
2.25+:ID: 70008815-9634-48ca-b672-b8dcf2a44074
2.26+:END:
2.27+#+name: wc-dir-lines
2.28+#+begin_src shell :var dir="."
2.29+cd $dir && cat * | wc -l
2.30+#+end_src
2.31+
2.32+* wc-dir-words :fs:
2.33+:PROPERTIES:
2.34+:ID: be755790-f367-4654-87e5-cd2927bfef45
2.35+:END:
2.36+#+name: wc-dir-words
2.37+#+begin_src shell :var dir="."
2.38+cd $dir && cat * | wc -w
2.39+#+end_src
2.40+
2.41+* tokei-dir-lines :fs:
2.42+:PROPERTIES:
2.43+:ID: 670e9855-f8d2-43eb-86af-3ef7292f90b9
2.44+:END:
2.45+#+name: tokei-dir-lines
2.46+#+begin_src shell :var src=(org-sbe org-current-h1-title) :results output replace
2.47+ cd ~/comp/$src
2.48+ input=`tokei -C -o json`
2.49+ echo $input | jq -r '.["Total"] | .code, .comments, .blanks'
2.50+#+end_src
2.51+
2.52+* tokei-dir-langs :fs:
2.53+:PROPERTIES:
2.54+:ID: ff9682f0-bb64-427f-a87d-e0c655f9fdc9
2.55+:END:
2.56+#+name: tokei-dir-langs
2.57+#+begin_src shell :var src=(org-sbe org-current-h1-title) :results output replace
2.58+ cd ~/comp/$src
2.59+ input=`tokei -C -o json`
2.60+ echo $input | jq -r '.["Total"].children | keys[]'
2.61+#+end_src
2.62+
2.63+* sum-str-nums :util:
2.64+:PROPERTIES:
2.65+:ID: d3c4ac69-337f-430b-a4db-760504f099ea
2.66+:END:
2.67+#+name: sum-str-nums
2.68+#+begin_src emacs-lisp :var s=tokei-dir-lines
2.69+ (let ((tot 0))
2.70+ (cl-loop
2.71+ with tot = 0
2.72+ for i in (split-string s) do
2.73+ (setf tot (+ tot (string-to-number i)))
2.74+ finally return tot))
2.75+#+end_src
2.76+
2.77+* org-task-tbl :org:
2.78+:PROPERTIES:
2.79+:ID: 0ee5b499-6f0b-4e15-8c6e-4876e90c20a9
2.80+:END:
2.81+#+name: org-task-tbl
2.82+#+begin_src emacs-lisp
2.83+ (let* ((ast (org-element-parse-buffer)) ;; built up the abstract syntax tree of the org buffer
2.84+ item-types ; all occuring item types. It could be that some task has more item types than another.
2.85+ tasks ; accumulation list for the tasks
2.86+ current-task ; name of the current task (header of level 1)
2.87+ task-items) ; items of the current task
2.88+ (org-element-map ast 'headline
2.89+ (lambda (hl)
2.90+ (cl-case (org-element-property :level hl)
2.91+ (1 ; We assume here that headers of level 1 are tasks.
2.92+ (when current-task ; registering the old task
2.93+ (setq tasks (cons (cons current-task (nreverse task-items)) tasks)))
2.94+ (setq current-task (org-element-property :raw-value hl) ; preparing the new task
2.95+ task-items nil))
2.96+ (2 ; item
2.97+ (let ((item-type (org-element-property :raw-value hl)))
2.98+ (setq item-types (cons item-type item-types))
2.99+ (setq task-items (cons (cons item-type (org-element-property :todo-keyword hl))
2.100+ task-items)))))))
2.101+ (setq tasks (nreverse (cons (cons current-task (nreverse task-items)) tasks)) ;add the last task
2.102+ item-types (sort (cl-remove-duplicates (nreverse item-types) :test 'string-equal) ; list of unique item types
2.103+ #'string<)) ;;Sorting the items lexicographical. Other criteria could be applied.
2.104+ ;;;;;;;;;;
2.105+ ;; generating the output table:
2.106+ (apply
2.107+ #'list
2.108+ (cons "Item" (mapcar #'car tasks)) ; header
2.109+ 'hline
2.110+ ;; rows:
2.111+ (mapcar
2.112+ ;; mapping the items to the todo states associated to the tasks:
2.113+ (lambda (item-type)
2.114+ (cons item-type
2.115+ (mapcar
2.116+ (lambda (task)
2.117+ (let ((todo-status (cdr (assoc-string item-type task))))
2.118+ todo-status))
2.119+ tasks)))
2.120+ item-types)))
2.121+#+end_src
2.122+
2.123+* org-headlines-map :org:
2.124+:PROPERTIES:
2.125+:ID: 05955228-ca76-48bc-b769-f648b4310a9c
2.126+:END:
2.127+#+name: org-headlines-map
2.128+#+begin_src elisp
2.129+ (org-element-map (org-element-parse-buffer 'headline )
2.130+ 'headline
2.131+ (lambda(hl)
2.132+ (let ((parent (org-element-property :parent hl )))
2.133+ (and (eq (org-element-type parent) 'headline)
2.134+ (list (org-element-property :title parent) (org-element-property :title hl))))))
2.135+
2.136+#+end_src
2.137+
2.138+* make-info-tbl :org:fs:vc:
2.139+:PROPERTIES:
2.140+:ID: d5ba2f3d-fc2d-4db6-8bbd-7ca440ff0e8c
2.141+:END:
2.142+#+name: make-info-tbl
2.143+#+header: :var version="0.1.0"
2.144+#+header: :var name=(org-sbe org-current-h1-title)
2.145+#+header: :var dir="/home/ellis/comp/"
2.146+#+begin_src emacs-lisp :results table replace
2.147+ (let* ((src (concat dir name))
2.148+ (age (org-sbe "hg-log-age" ''(dir src)))
2.149+ (rev (org-sbe "hg-rev" ''(dir src)))
2.150+ (num (org-sbe "hg-id-num" ''(dir src)))
2.151+ (cc1 (org-sbe "tokei-dir-lines" ''((dir src))))
2.152+ (cc2 (org-sbe "tokei-dir-langs" ''((dir src))))
2.153+ (nf (format "[[comp:docs/%s][%s]]" name name))
2.154+ (rf (format "[[vc:comp/%s][%s:%s]]" name num rev))
2.155+ ;; (gf (format "[[https://github.com/richardwesthaver/%s][github]]" name))
2.156+ (vf (format "%s" rf))
2.157+ (lsum (org-sbe sum-str-nums ('s 'cc1)))
2.158+ (l (split-string cc1))
2.159+ (lang (split-string cc2))
2.160+ (cf (format "%s = λ:%s #:%s _:%s" lsum (pop l) (pop l) (pop l))))
2.161+ `(hline
2.162+ (name ,nf)
2.163+ (version ,version)
2.164+ (vc ,vf)
2.165+ (updated ,age)
2.166+ (lines ,cf)
2.167+ (langs ,lang)
2.168+ hline))
2.169+ #+end_src
2.170+
2.171+ #+RESULTS: make-info-tbl
2.172+ |---------+----------------------------|
2.173+ | name | [[https://compiler.company/docs/org][org]] |
2.174+ | version | 0.1.0 |
2.175+ | vc | [[https://vc.compiler.company/comp/org][41+:0f4d1a0415d5]] |
2.176+ | updated | 3 hours ago |
2.177+ | lines | 13143 = λ:12268 #:46 _:829 |
2.178+ | langs | (Html Org Svg) |
2.179+ |---------+----------------------------|
2.180+
2.181+* make-files-tbl :org:fs:
2.182+:PROPERTIES:
2.183+:ID: e2ff9dcf-8340-48b8-a1a6-e0036cbcc495
2.184+:END:
2.185+#+name: ls-files
2.186+#+begin_src sh :results silent :var dir=(expand-file-name "~/comp") name=(org-sbe org-current-h1-title)
2.187+ ls -lh $dir/$name --time-style=long-iso \
2.188+ |awk '{if (NR!=1) print $8, $5, $6"-"$7}' \
2.189+ |awk 'BEGIN{print "file size updated"}{print $0}'
2.190+#+end_src
2.191+
2.192+#+name: make-files-tbl
2.193+#+begin_src python :var tab=ls-files() :results table :colnames yes :hlines yes :exports results :eval no-export
2.194+return tab
2.195+#+end_src
2.196+
2.197+* org-current-h1-title :org:
2.198+:PROPERTIES:
2.199+:ID: ae61e7ed-c9ed-414c-8a5f-12b1702f018e
2.200+:END:
2.201+#+name: org-current-h1-title
2.202+#+begin_src emacs-lisp :results value
2.203+ (org-element-property :title (save-excursion (org-up-heading-safe) (org-element-at-point)))
2.204+#+end_src
2.205+
2.206+#+RESULTS: org-current-h1-title
2.207+: org
2.208+
2.209+* get-emacs-version :emacs:
2.210+:PROPERTIES:
2.211+:ID: af3d83a1-31bd-41b4-be35-c1f33507fd8d
2.212+:END:
2.213+#+name: get-emacs-version
2.214+#+begin_src elisp :results output
2.215+ (princ (concat (format "%s\n" (emacs-version))
2.216+ (format "Org v%s" (org-version))))
2.217+#+end_src
2.218+
2.219+* hg-rev :vc:
2.220+:PROPERTIES:
2.221+:ID: 8119cf43-f2e7-4829-939c-fc4e8531ae6c
2.222+:END:
2.223+#+name: hg-rev
2.224+#+begin_src sh :var src=(org-sbe org-current-h1-title)
2.225+cd ~/comp/$src && hg log -l 1 --template '{node|short}'
2.226+#+end_src
2.227+
2.228+#+RESULTS: hg-rev
2.229+: 4de12ceca1c7
2.230+
2.231+* hg-id-num :vc:
2.232+:PROPERTIES:
2.233+:ID: 9602faee-5522-445b-a568-be603e20a978
2.234+:END:
2.235+#+name: hg-id-num
2.236+#+begin_src shell :var src=(org-sbe org-current-h1-title)
2.237+cd ~/comp/$src && hg id -n
2.238+#+end_src
2.239+
2.240+#+RESULTS: hg-id-num
2.241+: 36+
2.242+
2.243+* hg-log-age :vc:
2.244+:PROPERTIES:
2.245+:ID: 8492f4fb-51a6-4221-8705-a15eb5a50ed4
2.246+:END:
2.247+#+name: hg-log-age
2.248+#+begin_src shell :var src=(org-sbe org-current-h1-title)
2.249+ cd ~/comp/$src && hg log -l1 --template "{date|age}"
2.250+#+end_src
2.251+
2.252+#+RESULTS: hg-log-age
2.253+: 4 days ago
2.254+
2.255+* sh-ob-tangle :org:
2.256+:PROPERTIES:
2.257+:ID: 7b311df4-83a3-489d-89a0-929928bce051
2.258+:END:
2.259+#+name: sh-ob-tangle
2.260+#+begin_src sh
2.261+ emacs -Q --batch --eval "
2.262+ (progn
2.263+ (require 'ob-tangle)
2.264+ (dolist (file command-line-args-left)
2.265+ (with-current-buffer (find-file-noselect file)
2.266+ (org-babel-tangle))))
2.267+ " "$@"
2.268+#+end_src
2.269+
2.270+* make-dot-tree :dot:
2.271+:PROPERTIES:
2.272+:ID: 5588f446-2d7a-4261-b829-68effd3778ac
2.273+:END:
2.274+#+name: make-dot-tree
2.275+#+begin_src emacs-lisp :var table=org-headlines-map :results output
2.276+ (mapcar #'(lambda (x)
2.277+ (princ (format "\"%s\" -> \"%s\";\n" (cl-first x) (cl-second x))))
2.278+ table)
2.279+#+end_src
2.280+
2.281+* gen-dot-tree :dot:
2.282+:PROPERTIES:
2.283+:ID: a51c943d-0f01-4c8f-96ec-db28ae7fef26
2.284+:END:
2.285+#+name: gen-dot-tree
2.286+#+begin_src dot :file /tmp/tree.png :cmdline -Kdot -Tpng :var input=make-dot-tree :eval no-export
2.287+digraph {
2.288+ rankdir=TB;
2.289+ splines=true;
2.290+ node [shape=box];
2.291+ $input
2.292+ }
2.293+#+end_src
2.294+
2.295+* user-slime :lisp:
2.296+:PROPERTIES:
2.297+:ID: 9ffd1d10-ffad-486e-9d7d-82422342b9ff
2.298+:END:
2.299+#+name: user-slime
2.300+#+begin_src emacs-lisp :results silent :eval no-export
2.301+ (unless (slime-connected-p) (slime))
2.302+ (slime-eval '(ql:quickload :user))
2.303+ (slime-eval '(cl:in-package :user))
2.304+#+end_src
2.305+* std-slime :lisp:
2.306+:PROPERTIES:
2.307+:ID: 334dae41-5c35-48bd-8368-71d79f5e48d8
2.308+:END:
2.309+#+name: std-slime
2.310+#+begin_src emacs-lisp :results silent :eval no-export
2.311+ (slime)
2.312+ (slime-eval '(ql:quickload :std))
2.313+ (slime-eval '(in-package :std-user))
2.314+#+end_src
2.315+
2.316+* cargo-update-dir :rust:
2.317+:PROPERTIES:
2.318+:ID: 67dc87bb-a27b-46e4-a02f-58daac514630
2.319+:END:
2.320+#+name: cargo-update-dir
2.321+#+begin_src sh :var dir=()
2.322+# update all crates in dir
2.323+set -eu
2.324+case $0 in
2.325+ (/*) dir=${0%/*}/;;
2.326+ (*/*) dir=./${0%/*};;
2.327+ (*) dir=.;;
2.328+esac
2.329+
2.330+find "$dir/.." -name Cargo.toml -execdir cargo update \;
2.331+#+end_src
2.332+** rust-target-triple
2.333+:PROPERTIES:
2.334+:ID: 02f96ff2-c607-4889-979c-943203b8ad65
2.335+:END:
2.336+ #+name: rust-target-triple
2.337+ #+begin_src shell
2.338+ rustc -vV | sed -n -e 's/^host: //p'
2.339+ #+end_src
3.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2+++ b/glossary.org Mon Aug 12 18:31:37 2024 -0400
3.3@@ -0,0 +1,26 @@
3.4+#+title: glossary
3.5+#+author: Richard Westhaver
3.6+#+description: CC Glossary
3.7+#+setupfile: ../clean.theme
3.8+* Terms
3.9+:PROPERTIES:
3.10+:ID: 755feacc-24d1-4e6d-aff7-dd46270ee0b6
3.11+:CUSTOM_ID: terms
3.12+:END:
3.13+- GNU/Linux :: An Operating System that is free software, consisting
3.14+ of GNU packages released by the [[https://www.gnu.org/home.en.html][GNU Project]].
3.15+- Linux :: A free and open-source Kernel. Not to be confused with
3.16+ GNU/Linux the Operating System
3.17+* Acronyms
3.18+:PROPERTIES:
3.19+:ID: 6ea8f879-29f1-4a52-8e39-4d0920318f8a
3.20+:CUSTOM_ID: acronyms
3.21+:END:
3.22+- WRT :: With Respect To
3.23+- EC :: Emacs Client
3.24+- GNU :: A recursive acronym for "GNU's Not Unix", usually in
3.25+ reference to Linux.
3.26+- OS :: Operating System
3.27+- DB :: Database
3.28+- KV :: Key:Value
3.29+- IFF :: If and Only If
4.1--- a/mindset.org Sun Aug 11 14:47:55 2024 -0400
4.2+++ b/mindset.org Mon Aug 12 18:31:37 2024 -0400
4.3@@ -2,3 +2,5 @@
4.4 #+author: Richard Westhaver
4.5 #+description: A Reflection on the CC Mindset
4.6 #+setupfile: ../../clean.theme
4.7+#+glossary_sources: acronyms
4.8+[[gls:WRT]]
5.1--- a/pitch.org Sun Aug 11 14:47:55 2024 -0400
5.2+++ b/pitch.org Mon Aug 12 18:31:37 2024 -0400
5.3@@ -1,6 +1,6 @@
5.4 #+title: the big picture
5.5 #+author: Richard Westhaver <ellis@rwest.io>
5.6-#+setupfile: ../../clean.theme
5.7+#+setupfile: ../clean.theme
5.8 * Get Off of My Cloud
5.9 :PROPERTIES:
5.10 :ID: 6dbb0064-1421-41bb-b2df-36f694efce0a
6.1--- a/readme.org Sun Aug 11 14:47:55 2024 -0400
6.2+++ b/readme.org Mon Aug 12 18:31:37 2024 -0400
6.3@@ -1,9 +1,10 @@
6.4-#+title: Meta Docs
6.5+#+title: Meta
6.6 #+author: Richard Westhaver
6.7 #+email: ellis@rwest.io
6.8+#+description: CC Meta
6.9 #+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil
6.10 #+EXPORT_FILE_NAME: index
6.11-#+setupfile: ../../clean.theme
6.12+#+setupfile: ../clean.theme
6.13 * [[file:ulang.org][ulang]]
6.14 :PROPERTIES:
6.15 :ID: 0ecd9330-de4d-4adf-bb7f-75d12f973a0a
6.16@@ -24,7 +25,19 @@
6.17 :PROPERTIES:
6.18 :ID: 7a338797-f0bb-46ee-8bc0-81b9c874b7bb
6.19 :END:
6.20+* [[file:pitch.org][pitch]]
6.21+:PROPERTIES:
6.22+:ID: 84f7ffcf-061c-4461-aca9-236097a7b575
6.23+:END:
6.24 * [[file:workflows.org][workflows]]
6.25 :PROPERTIES:
6.26 :ID: c7dc2ecf-7655-4ce6-b6e7-52674364e8fc
6.27 :END:
6.28+* [[file:babel.org][babel]]
6.29+:PROPERTIES:
6.30+:ID: 182030df-f6ba-4749-958a-f28cb510866e
6.31+:END:
6.32+* [[file:glossary.org][glossary]]
6.33+:PROPERTIES:
6.34+:ID: 280de24a-a9df-4f0b-96a1-47341e8095ff
6.35+:END:
7.1--- a/style.org Sun Aug 11 14:47:55 2024 -0400
7.2+++ b/style.org Mon Aug 12 18:31:37 2024 -0400
7.3@@ -1,7 +1,8 @@
7.4 #+title: The Compiler Company Styleguide
7.5 #+author: Richard Westhaver
7.6 #+email: ellis@rwest.io
7.7-#+setupfile: ../../clean.theme
7.8+#+glossary_sources: acronyms terms
7.9+#+setupfile: ../clean.theme
7.10 As an organization we maintain a styleguide[fn:1] which lists all of
7.11 the style guidelines we use for our code. If you are contributing to
7.12 one of our projects, you should review and understand the relevant
8.1--- a/tech.org Sun Aug 11 14:47:55 2024 -0400
8.2+++ b/tech.org Mon Aug 12 18:31:37 2024 -0400
8.3@@ -2,7 +2,7 @@
8.4 #+author: Richard Westhaver
8.5 #+email: ellis@rwest.io
8.6 #+description: The Compiler Company Core Technologies
8.7-#+setupfile: ../../clean.theme
8.8+#+setupfile: ../clean.theme
8.9
8.10 * OS
8.11 :PROPERTIES:
10.1--- a/workflows.org Sun Aug 11 14:47:55 2024 -0400
10.2+++ b/workflows.org Mon Aug 12 18:31:37 2024 -0400
10.3@@ -2,21 +2,38 @@
10.4 #+author: Richard Westhaver
10.5 #+email: ellis@rwest.io
10.6 #+description: Meta Workflows
10.7-#+setupfile: ../../clean.theme
10.8+#+setupfile: ../clean.theme
10.9 * Roadmap
10.10 :PROPERTIES:
10.11 :ID: be90c808-6c3b-4381-a032-af07d54f5907
10.12 :END:
10.13+The [[https://compiler.company/plan/roadmap.html][roadmap]] is a high-level document which describes the strategic
10.14+plan associated with some pre-determined period of time, such as a
10.15+year, month, or quarter.
10.16
10.17+* Archive
10.18+:PROPERTIES:
10.19+:ID: ca0dcc07-0517-4d04-86f0-905537cb7801
10.20+:END:
10.21+When an item is archived, it is moved to a file under version-control
10.22+in the [[vc:comp/archive][archive]] project.
10.23 * Task Management
10.24 :PROPERTIES:
10.25 :ID: 66333c80-aa6f-43d7-a305-44e218dde045
10.26 :END:
10.27+Tasks are most often found as headings with some additional metadata
10.28+such as scheduling info, priority, clock info, and special properties.
10.29+
10.30+Task keywords are always part of a sequence with at least one =TODO=
10.31+state and one =DONE= state.
10.32 * Project Management
10.33 :PROPERTIES:
10.34 :ID: 560f4094-e077-4389-9e09-dba1e0d4004e
10.35 :END:
10.36-* Source Code Management
10.37+Projects are denoted by the special keyword =PROJECT= and act as
10.38+formal units of organization.
10.39+
10.40+* Code Management
10.41 :PROPERTIES:
10.42 :ID: 81da5e76-2619-42c3-8a2a-dea2b815b261
10.43 :END:
10.44@@ -25,12 +42,19 @@
10.45 :PROPERTIES:
10.46 :ID: e5c4702e-581d-41b7-a484-76730435f056
10.47 :END:
10.48-
10.49-* Attachments
10.50+** Tables
10.51 :PROPERTIES:
10.52-:ID: c179c71d-3ad6-480b-bb52-76307b4a6316
10.53+:ID: 8433beaf-59de-4b13-a066-8d3e636066a1
10.54+:END:
10.55+* Knowledge Management
10.56+:PROPERTIES:
10.57+:ID: ad28e021-657d-4073-b541-336df389c9fb
10.58 :END:
10.59-* Archive
10.60+** Notes
10.61 :PROPERTIES:
10.62-:ID: ca0dcc07-0517-4d04-86f0-905537cb7801
10.63+:ID: 6ebed997-12c0-4a20-88ef-df8cf424b198
10.64 :END:
10.65+** Documentation
10.66+:PROPERTIES:
10.67+:ID: 03e13d7e-6cda-46d4-830f-5671518bd32f
10.68+:END: