about summary refs log tree commit diff stats
path: root/content
diff options
context:
space:
mode:
authorAlan Pearce2022-04-30 19:00:04 +0200
committerAlan Pearce2022-04-30 19:00:04 +0200
commita8ad05ee11fd6c6c32dbadad30ed2013b08587ae (patch)
tree32c7c03f3839cde46bbfcfcda491c0448dd6b6b9 /content
parent5deeb3893fead388293e16317b8a3e8f178d9e25 (diff)
downloadwebsite-a8ad05ee11fd6c6c32dbadad30ed2013b08587ae.tar.lz
website-a8ad05ee11fd6c6c32dbadad30ed2013b08587ae.tar.zst
website-a8ad05ee11fd6c6c32dbadad30ed2013b08587ae.zip
Migrate syntax highlighting options to zola syntax
Diffstat (limited to 'content')
-rw-r--r--content/post/cedit-and-paredit.md2
-rw-r--r--content/post/emacs-package-archive-statistics.md20
-rw-r--r--content/post/opening-projects-with-projectile.md10
-rw-r--r--content/post/postfix-as-null-client-with-external-catchall.md4
-rw-r--r--content/post/self-hosted-git.md8
5 files changed, 22 insertions, 22 deletions
diff --git a/content/post/cedit-and-paredit.md b/content/post/cedit-and-paredit.md index cd395e9..89f8cb3 100644 --- a/content/post/cedit-and-paredit.md +++ b/content/post/cedit-and-paredit.md
@@ -28,7 +28,7 @@ paredit. Turns out it provides
28that control whether a space should be inserted. So, solving the 28that control whether a space should be inserted. So, solving the
29formatting issue turned out to be pretty simple: 29formatting issue turned out to be pretty simple:
30 30
31```elisp 31```lisp
32(defun ap/cedit-space-delimiter-p (endp delimiter) 32(defun ap/cedit-space-delimiter-p (endp delimiter)
33"Don't insert a space before delimiters in c-style modes" 33"Don't insert a space before delimiters in c-style modes"
34(not cedit-mode)) 34(not cedit-mode))
diff --git a/content/post/emacs-package-archive-statistics.md b/content/post/emacs-package-archive-statistics.md index 9a8e8bf..43d0969 100644 --- a/content/post/emacs-package-archive-statistics.md +++ b/content/post/emacs-package-archive-statistics.md
@@ -10,7 +10,7 @@ I use [cask][] for managing the dependencies of my Emacs
10configuration. Whenever I opened my `Cask` file, I wondered if I 10configuration. Whenever I opened my `Cask` file, I wondered if I
11really was using all the sources I had defined: 11really was using all the sources I had defined:
12 12
13```elisp 13```lisp
14(source gnu) 14(source gnu)
15(source marmalade) 15(source marmalade)
16(source melpa) 16(source melpa)
@@ -44,7 +44,7 @@ decided to try to figure out how to generate some usage statistics.
44I found [how to get a list of installed packages][], but that just gives 44I found [how to get a list of installed packages][], but that just gives
45a list: 45a list:
46 46
47```elisp 47```lisp
48(ace-jump-mode ag auto-compile auto-indent-mode autopair ...) 48(ace-jump-mode ag auto-compile auto-indent-mode autopair ...)
49``` 49```
50 50
@@ -52,7 +52,7 @@ I needed to get more information about those packages. I looked at
52where `list-packages` gets that information from. It seems that 52where `list-packages` gets that information from. It seems that
53`package-archive-contents` is a list of cons cells: 53`package-archive-contents` is a list of cons cells:
54 54
55```elisp 55```lisp
56(org-plus-contrib . 56(org-plus-contrib .
57 [(20140714) 57 [(20140714)
58 nil "Outline-based notes management and organizer" tar "org"]) 58 nil "Outline-based notes management and organizer" tar "org"])
@@ -62,7 +62,7 @@ Then created a function to loop over the contents of
62`package-activated-list`, retrieving the corresponding contents of 62`package-activated-list`, retrieving the corresponding contents of
63`package-archive-contents`: 63`package-archive-contents`:
64 64
65```elisp 65```lisp
66(defun package-list-installed () 66(defun package-list-installed ()
67 (loop for pkg in package-activated-list 67 (loop for pkg in package-activated-list
68 collect (assq pkg package-archive-contents))) 68 collect (assq pkg package-archive-contents)))
@@ -74,7 +74,7 @@ There are some helper functions in package.el such as
74needed. I happened to be using a pretest version of Emacs at the time 74needed. I happened to be using a pretest version of Emacs at the time
75and didn't know that it's not in 24.3, so I just made sure it was defined: 75and didn't know that it's not in 24.3, so I just made sure it was defined:
76 76
77```elisp 77```lisp
78(if (not (fboundp #'package-desc-archive)) 78(if (not (fboundp #'package-desc-archive))
79 (defsubst package-desc-archive (desc) 79 (defsubst package-desc-archive (desc)
80 (aref desc (1- (length desc))))) 80 (aref desc (1- (length desc)))))
@@ -89,7 +89,7 @@ To generate a list of statistics, I just needed to loop over the
89installed packages from `package-list-installed` and update a count 89installed packages from `package-list-installed` and update a count
90for each archive: 90for each archive:
91 91
92```elisp 92```lisp
93(defun package-archive-stats () 93(defun package-archive-stats ()
94 (let ((archives (makehash)) 94 (let ((archives (makehash))
95 (assoc '())) 95 (assoc '()))
@@ -105,7 +105,7 @@ for each archive:
105 105
106Running this gives a list of cons cells: 106Running this gives a list of cons cells:
107 107
108```elisp 108```lisp
109(("gnu" . 0) 109(("gnu" . 0)
110 ("org" . 1) 110 ("org" . 1)
111 ("melpa-stable" . 2) 111 ("melpa-stable" . 2)
@@ -116,7 +116,7 @@ Running this gives a list of cons cells:
116I wrapped it in an interactive function so that I could check the 116I wrapped it in an interactive function so that I could check the
117numbers quickly: 117numbers quickly:
118 118
119```elisp 119```lisp
120(defun package-show-archive-stats () 120(defun package-show-archive-stats ()
121 (interactive) 121 (interactive)
122 (message "%s" (package-archive-stats))) 122 (message "%s" (package-archive-stats)))
@@ -126,7 +126,7 @@ With that, I removed `(source gnu)` from my `Cask` file. Now I had
126another question. What package was installed from [marmalade][]? In 126another question. What package was installed from [marmalade][]? In
127the lisp fashion, I created yet another function: 127the lisp fashion, I created yet another function:
128 128
129```elisp 129```lisp
130(defun package-show-installed-from-archive (archive) 130(defun package-show-installed-from-archive (archive)
131 (interactive (list (helm-comp-read "Archive: " (mapcar #'car package-archives) 131 (interactive (list (helm-comp-read "Archive: " (mapcar #'car package-archives)
132 :must-match t))) 132 :must-match t)))
@@ -142,7 +142,7 @@ the lisp fashion, I created yet another function:
142 142
143Running this with the argument `"marmalade"` gives: 143Running this with the argument `"marmalade"` gives:
144 144
145```elisp 145```lisp
146(php-extras) 146(php-extras)
147``` 147```
148 148
diff --git a/content/post/opening-projects-with-projectile.md b/content/post/opening-projects-with-projectile.md index 775e2be..b44c5e8 100644 --- a/content/post/opening-projects-with-projectile.md +++ b/content/post/opening-projects-with-projectile.md
@@ -12,7 +12,7 @@ With this in mind, I decided to try to add support for opening projects under a
12 12
13I saw that projectile uses [Dash.el][] in some places, and after reading about [anaphoric macros], I decided that I'd try to use them to aid me. 13I saw that projectile uses [Dash.el][] in some places, and after reading about [anaphoric macros], I decided that I'd try to use them to aid me.
14 14
15```elisp 15```lisp
16(defun ap/subfolder-projects (dir) 16(defun ap/subfolder-projects (dir)
17 (--map (file-relative-name it dir) 17 (--map (file-relative-name it dir)
18 (-filter (lambda (subdir) 18 (-filter (lambda (subdir)
@@ -23,14 +23,14 @@ I saw that projectile uses [Dash.el][] in some places, and after reading about [
23 23
24First, this filters the non-special files under `dir`, filtering non-directories. Then it runs the list of `projectile-project-root-files-functions` on it to determine if it looks like a projectile project. To make the list more readable, it makes the filenames relative to the passed-in directory. It runs like this: 24First, this filters the non-special files under `dir`, filtering non-directories. Then it runs the list of `projectile-project-root-files-functions` on it to determine if it looks like a projectile project. To make the list more readable, it makes the filenames relative to the passed-in directory. It runs like this:
25 25
26```elisp 26```lisp
27(ap/subfolder-projects "~/projects") => 27(ap/subfolder-projects "~/projects") =>
28("dotfiles" "ggtags" …) 28("dotfiles" "ggtags" …)
29``` 29```
30 30
31So, we've got ourselves a list, but now we need to be able to open the project that's there, even though the folders are relative. 31So, we've got ourselves a list, but now we need to be able to open the project that's there, even though the folders are relative.
32 32
33```elisp 33```lisp
34(defun ap/open-subfolder-project (from-dir &optional arg) 34(defun ap/open-subfolder-project (from-dir &optional arg)
35 (let ((project-dir (projectile-completing-read "Open project: " 35 (let ((project-dir (projectile-completing-read "Open project: "
36 (ap/subfolder-projects from-dir)))) 36 (ap/subfolder-projects from-dir))))
@@ -43,7 +43,7 @@ We get support for multiple completion systems for free, since projectile has a
43 43
44Then I defined some helper functions to make it easy to open work and home projects. 44Then I defined some helper functions to make it easy to open work and home projects.
45 45
46```elisp 46```lisp
47(defvar work-project-directory "~/work") 47(defvar work-project-directory "~/work")
48(defvar home-project-directory "~/projects") 48(defvar home-project-directory "~/projects")
49 49
@@ -62,7 +62,7 @@ With this all set up, whenever I want to start working on a project I just type
62 62
63I also considered trying to add all the projects under a directory to the projectile known project list. I didn't find it quite as easy to use, but it's available below if anyone would prefer that style. 63I also considered trying to add all the projects under a directory to the projectile known project list. I didn't find it quite as easy to use, but it's available below if anyone would prefer that style.
64 64
65```elisp 65```lisp
66(defun ap/-add-known-subfolder-projects (dir) 66(defun ap/-add-known-subfolder-projects (dir)
67 (-map #'projectile-add-known-project (--map (concat (file-name-as-directory dir) it) (ap/subfolder-projects dir)))) 67 (-map #'projectile-add-known-project (--map (concat (file-name-as-directory dir) it) (ap/subfolder-projects dir))))
68 68
diff --git a/content/post/postfix-as-null-client-with-external-catchall.md b/content/post/postfix-as-null-client-with-external-catchall.md index 4a604b5..eb0a913 100644 --- a/content/post/postfix-as-null-client-with-external-catchall.md +++ b/content/post/postfix-as-null-client-with-external-catchall.md
@@ -11,7 +11,7 @@ It took me a while to figure out how to this, so I thought I'd share my method.
11 11
12Here's the config that can be used to do this on any NixOS host, after redefining the first two variables. 12Here's the config that can be used to do this on any NixOS host, after redefining the first two variables.
13 13
14```txt {linenos=table,hl_lines=["2-3"]} 14```txt,linenos,hl_lines=2-3
15services.postfix = let 15services.postfix = let
16 localUser = "example-user"; 16 localUser = "example-user";
17 forwardingAddress = "user@external.domain"; 17 forwardingAddress = "user@external.domain";
@@ -36,7 +36,7 @@ Emails to any user without a domain part are all sent to the forwarding address
36 36
37First, the basic setup for a null client can be found in the [postfix documentation][0]. The example config would be translated into NixOS like so: 37First, the basic setup for a null client can be found in the [postfix documentation][0]. The example config would be translated into NixOS like so:
38 38
39```txt {linenos=table} 39```txt
40services.postfix = { 40services.postfix = {
41 enable = true; 41 enable = true;
42 destination = []; 42 destination = [];
diff --git a/content/post/self-hosted-git.md b/content/post/self-hosted-git.md index 1cceff3..3bdbffb 100644 --- a/content/post/self-hosted-git.md +++ b/content/post/self-hosted-git.md
@@ -63,7 +63,7 @@ means that I can create a remote repository automatically by cloning a
63repository URL that doesn't already exist. 63repository URL that doesn't already exist.
64I can clone and create a new repo simultaneously like so: 64I can clone and create a new repo simultaneously like so:
65 65
66```shell 66```bash
67cd ~/projects 67cd ~/projects
68git clone alanpearce.eu:some-new-repository 68git clone alanpearce.eu:some-new-repository
69``` 69```
@@ -71,7 +71,7 @@ git clone alanpearce.eu:some-new-repository
71But with [ghq][], which I [blogged about before][using-ghq], I don't 71But with [ghq][], which I [blogged about before][using-ghq], I don't
72have to concern myself with where to put the repository: 72have to concern myself with where to put the repository:
73 73
74```shell 74```bash
75$ ghq get alanpearce.eu:some-new-repository 75$ ghq get alanpearce.eu:some-new-repository
76 clone ssh://alanpearce.eu/some-new-repository -> /Volumes/Code/projects/alanpearce.eu/some-new-repository 76 clone ssh://alanpearce.eu/some-new-repository -> /Volumes/Code/projects/alanpearce.eu/some-new-repository
77 git clone ssh://alanpearce.eu/some-new-repository /Volumes/Code/projects/alanpearce.eu/some-new-repository 77 git clone ssh://alanpearce.eu/some-new-repository /Volumes/Code/projects/alanpearce.eu/some-new-repository
@@ -93,7 +93,7 @@ Host alanpearce.eu
93This repository would be private by default, but I can change that by an 93This repository would be private by default, but I can change that by an
94SSH command. Here's how I would do it: 94SSH command. Here's how I would do it:
95 95
96```shell 96```bash
97ssh alanpearce.eu perms some-new-repository + READERS gitweb 97ssh alanpearce.eu perms some-new-repository + READERS gitweb
98ssh alanpearce.eu perms some-new-repository + READERS daemon 98ssh alanpearce.eu perms some-new-repository + READERS daemon
99``` 99```
@@ -106,7 +106,7 @@ user and not `gitweb`, if I wanted.
106I can also add or change the description of a repository shown on cgit like 106I can also add or change the description of a repository shown on cgit like
107so: 107so:
108 108
109```shell 109```bash
110ssh alanpearce.eu desc some-new-repository 'A new repository' 110ssh alanpearce.eu desc some-new-repository 'A new repository'
111``` 111```
112 112