diff options
author | EuAndreh <eu@euandre.org> | 2025-04-16 11:20:43 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-16 11:20:43 -0300 |
commit | d36c2e459a74ec67e523539eb98b78b95b01432a (patch) | |
tree | a7099fbfbdab6a21f59b6efe095bffb40ceae646 /src/content/tils/2021 | |
parent | src/content/style.css: Show header on hover only (diff) | |
download | euandre.org-d36c2e459a74ec67e523539eb98b78b95b01432a.tar.gz euandre.org-d36c2e459a74ec67e523539eb98b78b95b01432a.tar.xz |
src/content/: Normalize [source,$lang] code blocks
Diffstat (limited to 'src/content/tils/2021')
-rw-r--r-- | src/content/tils/2021/01/12/curl-awk-emails.adoc | 8 | ||||
-rw-r--r-- | src/content/tils/2021/01/17/posix-shebang.adoc | 6 | ||||
-rw-r--r-- | src/content/tils/2021/07/23/git-tls-gpg.adoc | 2 | ||||
-rw-r--r-- | src/content/tils/2021/08/11/js-bigint-reviver.adoc | 5 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/content/tils/2021/01/12/curl-awk-emails.adoc b/src/content/tils/2021/01/12/curl-awk-emails.adoc index 875c655..d432da2 100644 --- a/src/content/tils/2021/01/12/curl-awk-emails.adoc +++ b/src/content/tils/2021/01/12/curl-awk-emails.adoc @@ -18,7 +18,7 @@ write a solution. The first part was the easiest: store the email in a file: -[source,shell] +[source,sh] ---- # ~/.config/mutt/muttrc: set sendmail=~/bin/enqueue-email.sh @@ -32,7 +32,7 @@ cat - > "$HOME/mbsync/my-queued-emails/$(date -Is)" Now that I had the email file store locally, I needed a program to send the email from the file, so that I could create a cronjob like: -[source,shell] +[source,sh] ---- for f in ~/mbsync/my-queued-emails/*; do ~/bin/dispatch-email.sh "$f" && rm "$f" @@ -43,7 +43,7 @@ The `dispatch-email.sh` would have to look at the `From:` header and decide which SMTP server to use. As I {found-out-article}[found out] that {curl}[curl] supports SMTP and is able to send emails, this is what I ended up with: -[source,shell] +[source,sh] ---- #!/bin/sh -eu @@ -102,7 +102,7 @@ array. I even did it incrementally: -[source,shell] +[source,sh] ---- $ H='To: to@example.com, to2@example.com\nCc: cc@example.com, cc2@example.com\nBcc: bcc@example.com,bcc2@example.com\n' $ printf "$H" | awk '/^To: .*$/ { print $0 }' diff --git a/src/content/tils/2021/01/17/posix-shebang.adoc b/src/content/tils/2021/01/17/posix-shebang.adoc index 4e2fbe8..5cf0695 100644 --- a/src/content/tils/2021/01/17/posix-shebang.adoc +++ b/src/content/tils/2021/01/17/posix-shebang.adoc @@ -14,7 +14,7 @@ I didn't know what to do with that first line. What I had previously was: -[source,shell] +[source,sh] ---- #!/usr/bin/env bash set -Eeuo pipefail @@ -27,7 +27,7 @@ options were also gone, and would be replaced by nothing. I converted all of them to: -[source,shell] +[source,sh] ---- #!/bin/sh -eu ---- @@ -45,7 +45,7 @@ options is ignored, as it is a comment! Which means that the shebang most friendly with POSIX is: -[source,shell] +[source,sh] ---- #!/bin/sh set -eu diff --git a/src/content/tils/2021/07/23/git-tls-gpg.adoc b/src/content/tils/2021/07/23/git-tls-gpg.adoc index 8fe86c6..f198c2b 100644 --- a/src/content/tils/2021/07/23/git-tls-gpg.adoc +++ b/src/content/tils/2021/07/23/git-tls-gpg.adoc @@ -14,7 +14,7 @@ Here's how I'd verify that I've cloned an authentic version of HTTPS. ]: -[source,shell] +[source,sh] ---- $ wget -qO- https://euandre.org/public.asc | gpg --import - gpg: clef 81F90EC3CD356060 : « EuAndreh <eu@euandre.org> » n'est pas modifiée diff --git a/src/content/tils/2021/08/11/js-bigint-reviver.adoc b/src/content/tils/2021/08/11/js-bigint-reviver.adoc index f7dd3de..98ee79b 100644 --- a/src/content/tils/2021/08/11/js-bigint-reviver.adoc +++ b/src/content/tils/2021/08/11/js-bigint-reviver.adoc @@ -65,7 +65,8 @@ console.log(typeof parsed[7]["a-bigint"]) The output of the above is: -.... +[source,javascript] +---- [ null, true, @@ -79,7 +80,7 @@ The output of the above is: [null,true,false,-1,3.14,"a string",{"a-number":"-123"},{"a-bigint":"-123n"}] string bigint -.... +---- If you're on a web browser, you can probably try copying and pasting the above code on the console right now, as is. |