---
title: 'This week in #dev (Oct 20, 2023)'
teaser: 'Did you know that you can align text in Markdown tables? Or that you can
  use the `repeat` command in zsh to run a command multiple times? Read on to learn
  more!

  '
tags: this week in dev,til,tip,markdown,zsh,ruby
author: thoughtbot
published_on: 2023-11-01
---

Welcome to another edition of [This Week in #dev](https://thoughtbot.com/blog/tags/this-week-in-dev),
a series of posts where we bring some of our most interesting Slack
conversations to the public. Let's get to it!

## Text Alignment in Markdown Tables

[Neil Carvalho][neilson] discovered that Markdown tables can support text
alignment. By using a leading or trailing colon, you can indicate left, right,
or center alignment.

```md
| Country       | Population    |
| ------------- | ------------: |
| China         | 1,371,220,000 |
| India         | 1,296,834,042 |
| United States | 329,256,465   |
```

The above table will render as:

| Country | Population |
| ----------- | ----: |
| China | 1,371,220,000 |
| India | 1,296,834,042 |
| United States | 329,256,465 |

[neilson]: https://thoughtbot.com/blog/authors/neil-carvalho

## Need Country Information? Ruby's Got You Covered

[Matheus Richard][matheus] recommends the [countries
gem](https://github.com/countries/countries) for obtaining various information
about countries. The gem includes details such as the country local name,
currency, spoken languages, subdivisions, and timezones.

<aside class="info">
  <p>
    The information in this gem is based on ISO 3166, ISO 4217, and E.164.
  </p>
</aside>

[matheus]: https://thoughtbot.com/blog/authors/matheus-richard

## Repeating Commands in ZSH

[Neil][neilson] also shares how to easily repeat the same command multiple times in
[zsh].

```sh
repeat TIMES { command }
```

So, for example, if you wanted to run a test 10 times, you could do:

```sh
repeat 10 { bin/rspec spec/system/my_spec.rb }
```

[Louis] also points out that if you want to save the output to a file, but
also watch it in real-time, you can use `tee``:

```sh
repeat 10 { bin/rspec spec/system/my_spec.rb } | tee somefilename.txt
```

[neilson]: https://thoughtbot.com/blog/authors/neil-carvalho
[louis]: https://thoughtbot.com/blog/authors/louis-antonopoulos
[zsh]: https://www.zsh.org/

## Thanks

This edition was brought to you by [Louis Antonopoulos][louis],
[Matheus Richard][matheus], and [Neil Carvalho][neilson]. Thanks to all contributors! 🎉
