74 | ''
75 | ]
76 | # Prelude.List.map BashVsDhall Final element list
77 | # [ Final.Html "
\n" ]
78 |
79 | in toFinal list
80 |
--------------------------------------------------------------------------------
/notes/literate-devops-with-emacs.org:
--------------------------------------------------------------------------------
1 | [[https://www.youtube.com/watch?v=dljNabciEGg&feature=youtu.be][link to the video]] \\
2 | [[http://howardism.org/Technical/Emacs/literate-devops.html][original essay]]
3 |
4 | * General
5 | - Write in past tense so you don’t have to re-edit when mailing
6 |
7 | * Running Code
8 |
9 | [[http://orgmode.org/org.html#Working-with-source-code][relevant org-mode docs]]
10 |
11 | - cource code blocks can be created with ~~
12 | - =C-c C-c= executes
13 | - you first have to add the languages you want to be able to execute to
14 | =org-babel-load-languages=
15 | - ~:exports [code|results|both|none]~ to export code/
16 | - ~:dir ~ relative path for cwd
17 | - =C-c '= to open code block in its own buffer
18 | - ~:tangle ~ to export code block to file
19 | - code block attributes can be put in a section property, like
20 | #+BEGIN_SRC org
21 | :PROPERTIES:
22 | :dir:
23 | :END:
24 | #+END_SRC
25 | - name blocks with ~#+NAME: ~ (shortcut: ==)
26 |
27 | * Code Block Variables
28 |
29 | ~#+BEGIN_SRC :var VARNAME=~
30 |
31 | Note that =something= can be the name of a code block, then the value will be
32 | the output of that code block.
33 |
34 | - ~:results table~ returns a table that can be indexed like ~table[2,3]~
35 |
36 | * Executing Remote Code
37 |
38 | You can use tramp filenames and it will execute remotely
39 |
40 | ~:dir: /scp:my.server.com:mydir~
41 |
42 | * Transforming outputs with another source code block
43 |
44 | Create another code block that uses a variable, call this function from the
45 | first block with the ~:post~ command:
46 |
47 | #+BEGIN_SRC org
48 | \#+BEGIN_SRC :results value list :post column1(data=*this*)
49 | bla
50 | \#+END_SRC
51 |
52 | \#+BEGIN_SRC elisp :var data="" :results value
53 | (mapcar 'car data)
54 | \#+END_SRC
55 | #+END_SRC
56 |
57 | Source code blocks that can be used in multiple projects can be put into the
58 | org-mode “tower of babel”. (Personal note: It is debatable whether this is a
59 | good idea, since now everything depends on your local setup.)
60 |
61 | * Misc tramp Goodies
62 | ** Speeding up tramp connections with sessions
63 | Add a ~:session: