Fix code fences
This commit is contained in:
@@ -105,7 +105,7 @@ change this value, add the following to the "Custom Chef JSON" field:
|
||||
}
|
||||
}
|
||||
}
|
||||
````
|
||||
```
|
||||
|
||||
(Substituting in your own application and environment names.)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -81,7 +81,7 @@ So imagine an article like this:
|
||||
|
||||
```html
|
||||
<h1>Headline</h1> <p>A paragraph.</p> <ul><li>List item #1</li> <li>List item #2</li></ul>
|
||||
````
|
||||
```
|
||||
|
||||
Our initial approach (with `strip_tags`) gives us this:
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -14,7 +14,7 @@ in Rails:
|
||||
=> #<Goal id: 1, description: "Run a mile", created_at: "2008-09-09 19:32:57", updated_at: "2008-09-09 19:32:57">
|
||||
>> 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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user