From 570ec471d1605318aeefb030cd78682ae442235b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 31 Mar 2025 21:51:40 -0300 Subject: src/content/: Update all files left to asciidoc --- .../pastebins/2021/04/03/naive-slugify-js.adoc | 21 ++------ .../pastebins/2021/06/08/reading-session-pt1.adoc | 19 ++----- src/content/pastebins/2021/06/22/curl-wget.adoc | 24 +++------ src/content/pastebins/2021/08/11/h1-spacing.adoc | 62 ++++++++-------------- src/content/pastebins/2021/09/02/sicp-3-19.adoc | 24 +++------ .../2021/09/03/sicp-persistent-queue.adoc | 37 +++++-------- 6 files changed, 57 insertions(+), 130 deletions(-) (limited to 'src/content/pastebins/2021') diff --git a/src/content/pastebins/2021/04/03/naive-slugify-js.adoc b/src/content/pastebins/2021/04/03/naive-slugify-js.adoc index f765495..648e5fa 100644 --- a/src/content/pastebins/2021/04/03/naive-slugify-js.adoc +++ b/src/content/pastebins/2021/04/03/naive-slugify-js.adoc @@ -1,20 +1,7 @@ ---- += JavaScript naive slugify -title: JavaScript naive slugify - -date: 2021-04-03 - -updated_at: 2021-08-15 - -layout: post - -lang: en - -ref: javascript-naive-slugify - ---- - -```javascript +[source,javascript] +---- const s = "Pézão: açaí, saci-pererê."; const slugify = s => @@ -37,4 +24,4 @@ const slugify = s => .replaceAll("ç", "c"); console.log(slugify(s)); -``` +---- diff --git a/src/content/pastebins/2021/06/08/reading-session-pt1.adoc b/src/content/pastebins/2021/06/08/reading-session-pt1.adoc index b97ef08..d9f1f91 100644 --- a/src/content/pastebins/2021/06/08/reading-session-pt1.adoc +++ b/src/content/pastebins/2021/06/08/reading-session-pt1.adoc @@ -1,18 +1,7 @@ ---- += Debit Reading Session - SICP solutions pt.1 -title: Debit Reading Session - SICP solutions pt.1 - -date: 2021-06-08 - -layout: post - -lang: en - -ref: debit-reading-session-sicp-solutions-pt-1 - ---- - -```scheme +[source,scheme] +---- ;; 1.41 (define (double f) (lambda (x) @@ -72,6 +61,6 @@ ref: debit-reading-session-sicp-solutions-pt-1 ;;; 2.32 TODO -``` +---- FYI: I just typed those in, I didn't yet test them yet. diff --git a/src/content/pastebins/2021/06/22/curl-wget.adoc b/src/content/pastebins/2021/06/22/curl-wget.adoc index 1030c7b..08caf12 100644 --- a/src/content/pastebins/2021/06/22/curl-wget.adoc +++ b/src/content/pastebins/2021/06/22/curl-wget.adoc @@ -1,20 +1,9 @@ ---- - -title: "cloc: curl and wget" - -date: 2021-06-22 - -layout: post - -lang: en - -ref: cloc-curl-and-wget - ---- += "cloc: curl and wget" `curl`: -```shell +[source,shell] +---- $ pushd `mktemp -d` /tmp/tmp.AZkwvk7azD ~/ $ git clone git://github.com/curl/curl . @@ -62,11 +51,12 @@ TOML 1 0 0 ------------------------------------------------------------------------------------ SUM: 1309 39501 56083 254078 ------------------------------------------------------------------------------------ -``` +---- `wget`: -```shell +[source,shell] +---- $ pushd `mktemp -d` /tmp/tmp.NX0udlJMiz ~/ $ git clone git://git.savannah.gnu.org/wget.git . @@ -99,4 +89,4 @@ lex 1 29 65 73 -------------------------------------------------------------------------------- SUM: 342 11400 14185 52018 -------------------------------------------------------------------------------- -``` +---- diff --git a/src/content/pastebins/2021/08/11/h1-spacing.adoc b/src/content/pastebins/2021/08/11/h1-spacing.adoc index 9a00ece..e8a6986 100644 --- a/src/content/pastebins/2021/08/11/h1-spacing.adoc +++ b/src/content/pastebins/2021/08/11/h1-spacing.adoc @@ -1,29 +1,17 @@ ---- += Spaces around h1 tags -title: Spaces around h1 tags +// FIXME updated_at: 2021-08-15 -date: 2021-08-11 +_EDIT_: Apparently, the behaviour below is consistent between Firefox and +Chromium for links, but not for `

`. My conclusion is that the `

` +behaviour is a Firefox quirk, but the `` is expected. -updated_at: 2021-08-15 - -layout: post - -lang: en - -ref: spaces-around-h1-tags - ---- - -*EDIT*: Apparently, the behaviour below is consistent between Firefox and -Chromium for links, but not for `

`. -My conclusion is that the `

` behaviour is a Firefox quirk, but the `` is -expected. - ---- +''''' The HTML below has selectable extra spaces after `

` tags: -```html +[source,html] +---- @@ -43,23 +31,22 @@ The HTML below has selectable extra spaces after `

` tags: -``` +---- The rendered output is: -

- With spaces around when selecting this heading -

-

Without spaces around

-

- Is this expected behaviour? -

+With spaces around when selecting this heading + +Without spaces around ---- +Is this expected behaviour? + +''''' The same with links: -```html +[source,html] +---- @@ -80,17 +67,10 @@ The same with links: -``` +---- The rendered output is: -

- - With extra underlined space - - after the link. -

-

- Without extra underlined space - after the link. -

+With extra underlined space after the link. + +Without extra underlined space after the link. diff --git a/src/content/pastebins/2021/09/02/sicp-3-19.adoc b/src/content/pastebins/2021/09/02/sicp-3-19.adoc index 75ee346..f6aa8cf 100644 --- a/src/content/pastebins/2021/09/02/sicp-3-19.adoc +++ b/src/content/pastebins/2021/09/02/sicp-3-19.adoc @@ -1,18 +1,7 @@ ---- += SICP exercise 3.19 -title: SICP exercise 3.19 - -date: 2021-09-02 - -layout: post - -lang: en - -ref: sicp-exercise-3-19 - ---- - -```scheme +[source,scheme] +---- (define (cycle? l) (define (rec l x) (cond @@ -20,11 +9,12 @@ ref: sicp-exercise-3-19 ((eq? l x) true) (true (rec l (cdr x))))) (rec l (cdr l))) -``` +---- Sample interactive session: -```scheme +[source,scheme] +---- scheme@(guile-user)> (define true #t) scheme@(guile-user)> (define false #f) scheme@(guile-user)> @@ -39,4 +29,4 @@ scheme@(guile-user)> (cycle? '(1 2 3)) $9 = #f scheme@(guile-user)> (cycle? (make-cycle '(1 2 3))) $10 = #t -``` +---- diff --git a/src/content/pastebins/2021/09/03/sicp-persistent-queue.adoc b/src/content/pastebins/2021/09/03/sicp-persistent-queue.adoc index 8cf7ea2..2b4a8a2 100644 --- a/src/content/pastebins/2021/09/03/sicp-persistent-queue.adoc +++ b/src/content/pastebins/2021/09/03/sicp-persistent-queue.adoc @@ -1,36 +1,25 @@ ---- += SICP persistent amortized O(1) queue -title: SICP persistent amortized O(1) queue - -date: 2021-09-03 - -layout: post - -lang: en - -ref: sicp-persistent-amortized-o1-queue - ---- - -```scheme +[source,scheme] +---- (define (queue) (cons '() - '())) + '())) (define (enqueue x q) (cons (car q) - (cons x (cdr q)))) + (cons x (cdr q)))) (define (flush q) (cons (reverse (cdr q)) - '())) + '())) (define (dequeue q) (if (null? (car q)) (dequeue (flush q)) (cons (caar q) - (cons (cdar q) - (cdr q))))) + (cons (cdar q) + (cdr q))))) (define (empty? q) (and (null? (car q)) @@ -43,7 +32,7 @@ ref: sicp-persistent-amortized-o1-queue (define (rec l leading-space?) (when (not (null? l)) (when leading-space? - (display " ")) + (display " ")) (display (car l)) (rec (cdr l) #t))) @@ -52,10 +41,12 @@ ref: sicp-persistent-amortized-o1-queue (rec (reverse (cdr q)) (not (null? (car q)))) (display ")") (newline)) -``` +---- Sample interactive session: -```scheme + +[source,scheme] +---- scheme@(guile-user)> (define true #t) scheme@(guile-user)> (define false #f) scheme@(guile-user)> (define q (queue)) @@ -82,4 +73,4 @@ scheme@(guile-user)> (print-queue q) #q(b c d e) scheme@(guile-user)> (print-queue (cdr (dequeue (cdr (dequeue (enqueue 'g (enqueue 'f q))))))) #q(d e f g) -``` +---- -- cgit v1.2.3