Skip to content

Commit 1ddf9ec

Browse files
thiagowfxAmp
andcommitted
readme: add Patterns section with composable examples
Amp-Thread-ID: https://ampcode.com/threads/T-019c8266-8f81-776a-aa38-a24038207030 Co-authored-by: Amp <amp@ampcode.com>
1 parent b0ddbb1 commit 1ddf9ec

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ Releases follow calendar versioning ([calver](https://calver.org/) – `YYYY.MM.
7474
- **[wt](wt/)** - Manage git worktrees with ease (includes interactive TUI)
7575
<!-- keep-sorted end -->
7676

77+
## Patterns
78+
79+
These tools compose well together. A few ideas:
80+
81+
```bash
82+
# Watch for new commits upstream, then notify
83+
retry --until-changed -i 30 git pull && notify "Repo updated" "New commits pulled"
84+
85+
# Wait for a server to come up, then notify
86+
retry -v -t 120 curl -sf http://localhost:8080/health && notify -s "Server ready"
87+
88+
# OCR an image and copy the text to clipboard
89+
ocr screenshot.png | copy
90+
91+
# Wait for internet to come back, then notify
92+
retry -i 5 is_online -q && notify "Back online" "Internet restored"
93+
```
94+
7795
## Contributing
7896

7997
1. Create a new directory for your script (e.g., `my_tool/my_tool.sh`)

0 commit comments

Comments
 (0)