Update cheatsheets

This commit is contained in:
ivuorinen
2024-10-21 00:18:03 +00:00
parent 1d688aded3
commit b361fd494d
14 changed files with 123 additions and 18 deletions

29
tldr/bear Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# bear
> A tool to generate compilation databases for `clang` tooling.
> More information: <https://github.com/rizsotto/Bear>.
- Generate `compile_commands.json` by running a build command:
`bear -- {{make}}`
- Generate compilation database with a custom output file name:
`bear --output {{path/to/compile_commands.json}} -- {{make}}`
- Append results to an existing `compile_commands.json` file:
`bear --append -- {{make}}`
- Run in verbose mode to get detailed output:
`bear --verbose -- {{make}}`
- Force `bear` to use the preload method for command interception:
`bear --force-preload -- {{make}}`

25
tldr/cdecl Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# cdecl
> Compose and decode C and C++ type declarations.
> More information: <https://github.com/paul-j-lucas/cdecl>.
- Compose English phrase into C declaration, and create [c]ompilable output (include `;` and `{}`):
`cdecl -c {{phrase}}`
- Explain C declaration in English:
`cdecl explain {{C_declaration}}`
- Cast a variable to another type:
`cdecl cast {{variable_name}} to {{type}}`
- Run in [i]nteractive mode:
`cdecl -i`

View File

@@ -12,10 +12,6 @@ source: https://github.com/tldr-pages/tldr.git
`fastfetch`
- Display system information without a logo and escape sequences:
`fastfetch --pipe`
- Fetch a specific structure:
`fastfetch --structure {{structure}}`
@@ -28,6 +24,10 @@ source: https://github.com/tldr-pages/tldr.git
`fastfetch --logo {{logo}}`
- Display system information without a logo:
`fastfetch --logo none`
- Use a specific color for the keys and title:
`fastfetch --color {{blue}}`

View File

@@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git
`lambo new --{{vue|bootstrap|react}} {{app_name}}`
- Install npm dependencies after the project has been created:
- Install `npm` dependencies after the project has been created:
`lambo new --node {{app_name}}`

14
tldr/linux/links2 Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# links2
> Command-line web browser.
> See also: `links`.
> More information: <http://links.twibright.com/>.
- Visit a website in graphics mode:
`links2 -g {{https://example.com}}`

View File

@@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git
`ncu`
- List outdated global npm packages:
- List outdated global `npm` packages:
`ncu --global`

View File

@@ -33,10 +33,10 @@ source: https://github.com/tldr-pages/tldr.git
`npm uninstall {{package_name}}`
- List of locally installed dependencies:
- List all locally installed dependencies:
`npm list`
- List top-level globally installed packages:
- List all top-level globally installed packages:
`npm list {{-g|--global}} --depth {{0}}`

View File

@@ -8,19 +8,19 @@ source: https://github.com/tldr-pages/tldr.git
> Check the health of the npm environment.
> More information: <https://docs.npmjs.com/cli/commands/npm-doctor>.
- Run all default health checks for npm:
- Run all default health checks for `npm`:
`npm doctor`
- Check the connection to the npm registry:
- Check the connection to the `npm` registry:
`npm doctor connection`
- Check the versions of Node.js and npm in use:
- Check the versions of Node.js and `npm` in use:
`npm doctor versions`
- Check for permissions issues with npm directories and cache:
- Check for permissions issues with `npm` directories and cache:
`npm doctor permissions`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Open the npm page, Yarn page, or GitHub repository of a package in the web browser.
> More information: <https://github.com/sindresorhus/npm-home>.
- Open the npm page of a specific package in the web browser:
- Open the `npm` page of a specific package in the web browser:
`npm-home {{package}}`

View File

@@ -8,10 +8,10 @@ source: https://github.com/tldr-pages/tldr.git
> Check whether a package or organization name is available on npm.
> More information: <https://github.com/sindresorhus/npm-name-cli>.
- Check if a specific package name is available in the npm registry:
- Check if a specific package name is available in the `npm` registry:
`npm-name {{package}}`
- Find similar package names in the npm registry:
- Find similar package names in the `npm` registry:
`npm-name --similar {{package}}`

33
tldr/npm-team Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm team
> Manage teams in an organization on the `npm` registry.
> More information: <https://docs.npmjs.com/cli/commands/npm-team>.
- Add a user to a team in an organization:
`npm team add {{organization:team}} {{username}}`
- Remove a user from a team:
`npm team rm {{organization:team}} {{username}}`
- Create a new team in an organization:
`npm team create {{organization:team}}`
- Delete a team from an organization:
`npm team destroy {{organization:team}}`
- List all teams in an organization:
`npm team ls {{organization}}`
- List all users in a specific team:
`npm team ls {{organization:team}}`

View File

@@ -8,6 +8,6 @@ source: https://github.com/tldr-pages/tldr.git
> Identifies why an npm package is installed.
> More information: <https://github.com/amio/npm-why>.
- Show why an npm package is installed:
- Show why an `npm` package is installed:
`npm-why {{package}}`

View File

@@ -9,11 +9,11 @@ source: https://github.com/tldr-pages/tldr.git
> Note: This command is deprecated! Use `pnpm exec` and `pnpm dlx` instead.
> More information: <https://cuyl.github.io/pnpm.github.io/pnpx-cli>.
- Execute the binary from a given npm module:
- Execute the binary from a given `npm` module:
`pnpx {{module_name}}`
- Execute a specific binary from a given npm module, in case the module has multiple binaries:
- Execute a specific binary from a given `npm` module, in case the module has multiple binaries:
`pnpx --package {{package_name}} {{module_name}}`

View File

@@ -31,3 +31,7 @@ source: https://github.com/tldr-pages/tldr.git
- Type-check multiple JavaScript files, and output only the errors:
`tsc --allowJs --checkJs --noEmit {{src/**/*.js}}`
- Run the compiler in watch mode, which automatically recompiles code when it changes:
`tsc --watch`