diff --git a/tldr/gh-api b/tldr/gh-api index 395d5f02..a4dd1d41 100644 --- a/tldr/gh-api +++ b/tldr/gh-api @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - Display the result of a GraphQL query in JSON format: -`gh api graphql {{[-f|--field]}} {{name=':repo'}} {{[-f|--raw-field]}} '{{query}}'` +`gh api graphql {{[-F|--field]}} {{name=':repo'}} {{[-f|--raw-field]}} '{{query}}'` - Send a request using a custom HTTP method: diff --git a/tldr/ollama b/tldr/ollama index b1c93cd8..e6bfbd7c 100644 --- a/tldr/ollama +++ b/tldr/ollama @@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git > A large language model runner. > For a list of available models, see . -> More information: . +> More information: . - Start the daemon required to run other commands: @@ -17,9 +17,9 @@ source: https://github.com/tldr-pages/tldr.git `ollama run {{model}}` -- Run a model with a single prompt: +- Run a model with a single prompt and thinking turned off: -`ollama run {{model}} {{prompt}}` +`ollama run {{model}} --think=false "{{prompt}}"` - List downloaded models: diff --git a/tldr/windows/invoke-webrequest b/tldr/windows/invoke-webrequest index ea013966..abf688af 100644 --- a/tldr/windows/invoke-webrequest +++ b/tldr/windows/invoke-webrequest @@ -13,6 +13,10 @@ source: https://github.com/tldr-pages/tldr.git `Invoke-WebRequest {{http://example.com}} -OutFile {{path o ile}}` +- Only return raw HTML data instead of parsing it under Internet Explorer (PowerShell 3.0-5.1 only): + +`Invoke-WebRequest {{http://example.com}} -UseBasicParsing` + - Send form-encoded data (POST request of type `application/x-www-form-urlencoded`): `Invoke-WebRequest -Method Post -Body @{ name='bob' } {{http://example.com/form}}` diff --git a/tldr/zformat b/tldr/zformat new file mode 100644 index 00000000..08b8d7fb --- /dev/null +++ b/tldr/zformat @@ -0,0 +1,39 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# zformat + +> Format strings in Zsh. +> This builtin is part of the `zsh/zutil` module. +> See also: `zstyle`. +> More information: . + +- Load the zformat module: + +`zmodload zsh/zutil` + +- Format a string by replacing `%c` with a value and store the result in a variable: + +`zformat -f {{variable}} "{{Hello %c}}" {{c:world}}` + +- Format with right-padding (left-align) to a minimum width: + +`zformat -f {{variable}} "{{%10c}}" {{c:hello}}` + +- Format with left-padding (right-align) using negative width: + +`zformat -f {{variable}} "{{%-10c}}" {{c:hello}}` + +- Use ternary expression for conditional text (if value is 3, outputs "yes", otherwise "no"): + +`zformat -f {{variable}} "{{The answer is '%3(c.yes.no)'.}}" {{c:3}}` + +- Format with left-padding (right-align) using negative minimum width: + +`zformat -f {{variable}} "name: %-15n value: %-10v" {{n:value1}} {{v:value2}}` + +- Align strings (left:right pairs separated by colon): + +`zformat -a {{array}} {{:}} {{left1:right1}} {{left2:right2}}`