diff --git a/content/elsewhere/aws-opsworks-lessons-learned/index.md b/content/elsewhere/aws-opsworks-lessons-learned/index.md index db9ab72..52a022d 100644 --- a/content/elsewhere/aws-opsworks-lessons-learned/index.md +++ b/content/elsewhere/aws-opsworks-lessons-learned/index.md @@ -105,7 +105,7 @@ change this value, add the following to the "Custom Chef JSON" field: } } } -```` +``` (Substituting in your own application and environment names.) diff --git a/content/elsewhere/backup-your-database-in-git/index.md b/content/elsewhere/backup-your-database-in-git/index.md index 3873dcf..a1290a0 100644 --- a/content/elsewhere/backup-your-database-in-git/index.md +++ b/content/elsewhere/backup-your-database-in-git/index.md @@ -28,7 +28,7 @@ mysqldump -u [user] -p[pass] --skip-extended-insert [database] > [database].sql git init git add [database].sql git commit -m "Initial commit" -```` +``` The `--skip-extended-insert` option tells mysqldump to give each table row its own `insert` statement. This creates a larger initial commit diff --git a/content/elsewhere/extract-embedded-text-from-pdfs-with-poppler-in-ruby/index.md b/content/elsewhere/extract-embedded-text-from-pdfs-with-poppler-in-ruby/index.md index fab4ba6..6d33ded 100644 --- a/content/elsewhere/extract-embedded-text-from-pdfs-with-poppler-in-ruby/index.md +++ b/content/elsewhere/extract-embedded-text-from-pdfs-with-poppler-in-ruby/index.md @@ -46,13 +46,13 @@ In a (Debian-based) Dockerfile: RUN apt-get update && apt-get install -y libgirepository1.0-dev libpoppler-glib-dev && rm -rf /var/lib/apt/lists/* -```` +``` Then, in your `Gemfile`: ```ruby gem "poppler" -```` +``` ## Use it in your application diff --git a/content/elsewhere/five-turbo-lessons-i-learned-the-hard-way/index.md b/content/elsewhere/five-turbo-lessons-i-learned-the-hard-way/index.md index acebaba..1b6e8c8 100644 --- a/content/elsewhere/five-turbo-lessons-i-learned-the-hard-way/index.md +++ b/content/elsewhere/five-turbo-lessons-i-learned-the-hard-way/index.md @@ -25,7 +25,7 @@ just use the built-in Rails methods, i.e. ```ruby render turbo_stream: turbo_stream.update("flash", partial: "shared/flash") -```` +``` And though [DHH would disagree](https://github.com/hotwired/turbo-rails/issues/77#issuecomment-757349251), diff --git a/content/elsewhere/pandoc-a-tool-i-use-and-like/index.md b/content/elsewhere/pandoc-a-tool-i-use-and-like/index.md index 01212df..3ac59d5 100644 --- a/content/elsewhere/pandoc-a-tool-i-use-and-like/index.md +++ b/content/elsewhere/pandoc-a-tool-i-use-and-like/index.md @@ -81,7 +81,7 @@ So imagine an article like this: ```html

Headline

A paragraph.

-```` +``` Our initial approach (with `strip_tags`) gives us this: diff --git a/content/elsewhere/pluck-subset-rails-activerecord-model-attributes/index.md b/content/elsewhere/pluck-subset-rails-activerecord-model-attributes/index.md index 7eb94e3..c139c09 100644 --- a/content/elsewhere/pluck-subset-rails-activerecord-model-attributes/index.md +++ b/content/elsewhere/pluck-subset-rails-activerecord-model-attributes/index.md @@ -88,7 +88,7 @@ update our naïve approach to look like this: ```ruby dates = TimeEntry.all.map { |entry| entry.logged_on }.uniq -```` +``` When we profile this code, we see that it performs slightly worse than the non-unique version: diff --git a/content/elsewhere/protip-timewithzone-all-the-time/index.md b/content/elsewhere/protip-timewithzone-all-the-time/index.md index 78170be..50b7416 100644 --- a/content/elsewhere/protip-timewithzone-all-the-time/index.md +++ b/content/elsewhere/protip-timewithzone-all-the-time/index.md @@ -14,7 +14,7 @@ in Rails: => # >> Goal.find(:all, :conditions => ['created_at < ?', Time.now]) => [] -```` +``` Huh? Checking the logs, we see that the two commands above correspond to the following queries: @@ -22,7 +22,7 @@ the following queries: ```sql INSERT INTO "goals" ("updated_at", "description", "created_at") VALUES('2008-09-09 19:32:57', 'Run a mile', '2008-09-09 19:32:57') SELECT * FROM "goals" WHERE created_at < '2008-09-09 15:33:17' -```` +``` Rails stores `created_at` relative to [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while diff --git a/content/elsewhere/simple-commit-linting-for-issue-number-in-github-actions/index.md b/content/elsewhere/simple-commit-linting-for-issue-number-in-github-actions/index.md index 27e8292..f566b85 100644 --- a/content/elsewhere/simple-commit-linting-for-issue-number-in-github-actions/index.md +++ b/content/elsewhere/simple-commit-linting-for-issue-number-in-github-actions/index.md @@ -35,7 +35,7 @@ want something you can drop into a GitHub Actions YAML file to lint your commits, here it is (but stick around and I'll break it down and then show how to do it in a few other languages): -``` yaml +```yaml steps: - name: Checkout code uses: actions/checkout@v3 @@ -79,7 +79,7 @@ If you want to try this out locally (or perhaps modify the script to validate messages in a different way), here's a `docker run` command you can use: -``` bash +```bash echo '[#123] Message 1 [n/a] Message 2 [#122] Message 3' | docker run --rm -i ruby:3.2.1 ruby -e ' @@ -104,7 +104,7 @@ several of Viget's other favorites: ### JavaScript -``` bash +```bash git log --format=format:%s HEAD ^origin/main | node -e " let msgs = require('fs').readFileSync(0).toString().trim().split('\n'); for (let msg of msgs) { @@ -117,7 +117,7 @@ git log --format=format:%s HEAD ^origin/main | node -e " To test: -``` bash +```bash echo '[#123] Message 1 [n/a] Message 2 [#122] Message 3' | docker run --rm -i node:18.15.0 node -e " @@ -132,7 +132,7 @@ echo '[#123] Message 1 ### PHP -``` bash +```bash git log --format=format:%s HEAD ^origin/main | php -r ' while ($msg = fgets(STDIN)) { if (preg_match("/^\[(#\d+|n\/a)\]/", $msg)) { continue; } @@ -144,7 +144,7 @@ git log --format=format:%s HEAD ^origin/main | php -r ' To test: -``` bash +```bash echo '[#123] Message 1 [n/a] Message 2 [#122] Message 3' | docker run --rm -i php:8.2.4 php -r ' @@ -158,7 +158,7 @@ echo '[#123] Message 1 ### Python -``` bash +```bash git log --format=format:%s HEAD ^origin/main | python -c ' import sys import re @@ -172,7 +172,7 @@ for msg in sys.stdin: To test: -``` bash +```bash echo '[#123] Message 1 [n/a] Message 2 [#122] Message 3' | docker run --rm -i python:3.11.3 python -c ' diff --git a/content/elsewhere/simple-secure-file-transmission/index.md b/content/elsewhere/simple-secure-file-transmission/index.md index ea4a406..25ac137 100644 --- a/content/elsewhere/simple-secure-file-transmission/index.md +++ b/content/elsewhere/simple-secure-file-transmission/index.md @@ -43,7 +43,7 @@ encrypt the certificate, I'd run: ``` > encrypt.sh production.pem \ "I can get you a toe by 3 o'clock this afternoon." -```` +``` The script creates an encrypted file, `production.pem.enc`, and outputs instructions for decrypting it, but with the password blanked out.