1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 23:28:02 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
jbranchaud
5f11b1665b Remove dprint config to never text wrap
This was causing multi-line sequences of text in TIL markdown files to be
unwrapped into one long line.
2025-11-18 13:20:58 -06:00
jbranchaud
ce5ff038c0 Add Generate A Sequence Of Numbered Items as a Unix TIL 2025-11-18 13:20:49 -06:00
jbranchaud
486a6ef5a9 Add Open Current Prompt In Default Editor as a Claude Code TIL 2025-11-18 12:54:50 -06:00
4 changed files with 61 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1693 TILs and counting..._
_1695 TILs and counting..._
See some of the other learning resources I work on:
@@ -31,6 +31,7 @@ If you've learned something here, support my efforts writing daily TILs by
* [AWS](#aws)
* [Brew](#brew)
* [Chrome](#chrome)
* [Claude Code](#claude-code)
* [Clojure](#clojure)
* [CSS](#css)
* [Deno](#deno)
@@ -154,6 +155,10 @@ If you've learned something here, support my efforts writing daily TILs by
- [Trigger Commands From The Devtools Command Palette](chrome/trigger-commands-from-the-devtools-command-palette.md)
- [View Network Traffic For New Tabs](chrome/view-network-traffic-for-new-tabs.md)
### Claude Code
- [Open Current Prompt In Default Editor](claude-code/open-current-prompt-in-default-editor.md)
### Clojure
- [Aggregation Using merge-with](clojure/aggregation-using-merge-with.md)
@@ -1640,6 +1645,7 @@ If you've learned something here, support my efforts writing daily TILs by
- [Fix Unlinked Node Binaries With asdf](unix/fix-unlinked-node-binaries-with-asdf.md)
- [Forward Multiple Ports Over SSH](unix/forward-multiple-ports-over-ssh.md)
- [Generate A SAML Key And Certificate Pair](unix/generate-a-saml-key-and-certificate-pair.md)
- [Generate A Sequence Of Numbered Items](unix/generate-a-sequence-of-numbered-items.md)
- [Generate Base64 Encoding Without Newlines](unix/generate-base64-encoding-without-newlines.md)
- [Generate Random 20-Character Hex String](unix/generate-random-20-character-hex-string.md)
- [Get A List Of Locales On Your System](unix/get-a-list-of-locales-on-your-system.md)

View File

@@ -0,0 +1,15 @@
# Open Current Prompt In Default Editor
[Claude Code](https://www.claude.com/product/claude-code) gives you a single
line to write a prompt. You can write and write as much as you want, but it will
all be on that single line. And avoid accidentally hitting 'Enter' before you're
done.
I found myself wanting to space out my thoughts, create a code block as part of
a prompt, and generally have a scratch pad instead of just a text box. By
hitting `ctrl-g`, I can move the current prompt into my default editor (in my
case, `nvim`). From there I can continue to write, edit, and format with all the
affordances of an editor.
Once I'm done crafting the prompt, I can save (e.g. `:wq`) and Claude Code will
be primed with that text. I can then hit 'Enter' to let `claude` do its thing.

View File

@@ -1,7 +1,4 @@
{
"excludes": ["README.md"],
"markdown": {
"textWrap": "never"
},
"plugins": ["https://plugins.dprint.dev/markdown-0.16.0.wasm"]
}

View File

@@ -0,0 +1,39 @@
# Generate A Sequence Of Numbered Items
The `seq` command will output the specified sequence of numbers.
```bash
seq 1 5
1
2
3
4
5
```
With the `-f` (`--format`) flag we can interpolate those numbers as part of a
string.
```bash
seq -f "day_%02g" 1 5
day_01
day_02
day_03
day_04
day_05
```
The `%g` indicates that there is a format specifier for a numeric type which is
where `seq` will inject the current value in the sequence. The `02` indicates
that it should be `0` padded to `2` digits.
We can then pipe this to another unix command, such as `mkdir` in order to
quickly create a bunch of directories for, say, [Advent of Code](https://adventofcode.com/2024).
```bash
mkdir aoc_2024
cd aoc_2024
seq -f "day_%02g" 1 25 | xargs mkdir
```
See `man seq` for more details.