mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-29 21:27:47 +00:00
use typos
for corrections (#833)
I used [typos](https://github.com/crate-ci/typos/). I manually checked all the corrections and they seem safe to me. There are still some left, but those in this PR are good
This commit is contained in:
parent
a0aa600153
commit
afde2592a6
42 changed files with 102 additions and 90 deletions
|
@ -10849,7 +10849,7 @@
|
|||
"tags": [],
|
||||
"unicode_version": "6.0"
|
||||
}, {
|
||||
"aliases": ["womens"],
|
||||
"aliases": ["women"],
|
||||
"category": "Symbols",
|
||||
"description": "women’s room",
|
||||
"emoji": "🚺",
|
||||
|
|
|
@ -40,7 +40,7 @@ function contrast_colour {
|
|||
|
||||
# Uncomment the below for more precise luminance calculations
|
||||
|
||||
# # Calculate percieved brightness
|
||||
# # Calculate perceived brightness
|
||||
# # See https://www.w3.org/TR/AERT#color-contrast
|
||||
# # and http://www.itu.int/rec/R-REC-BT.601
|
||||
# # Luminance is in range 0..5000 as each value is 0..5
|
||||
|
|
|
@ -15,7 +15,7 @@ function Get-Character {
|
|||
# ~1900 ms
|
||||
function main {
|
||||
# This is the same script as gradient.ps1 but hard coded
|
||||
# to 40x160 for nushell comparisions
|
||||
# to 40x160 for nushell comparisons
|
||||
for ($y = 0; $y -le 39; $y++) {
|
||||
$Color = 25
|
||||
Set-Cursor -x $PSItem -y $y
|
||||
|
@ -31,7 +31,7 @@ function main {
|
|||
# Note that the x loop has half the characters so it doesn't count
|
||||
function main2 {
|
||||
# This is the same script as gradient.ps1 but hard coded
|
||||
# to 40x160 for nushell comparisions
|
||||
# to 40x160 for nushell comparisons
|
||||
for ($y = 0; $y -le 39; $y++) {
|
||||
$Color = 25
|
||||
$row = @()
|
||||
|
@ -44,11 +44,11 @@ function main2 {
|
|||
}
|
||||
}
|
||||
|
||||
# Store the characters in a string and contatenate, then output a row at a time
|
||||
# Store the characters in a string and concatenate, then output a row at a time
|
||||
# ~265 ms
|
||||
function main3 {
|
||||
# This is the same script as gradient.ps1 but hard coded
|
||||
# to 40x160 for nushell comparisions
|
||||
# to 40x160 for nushell comparisons
|
||||
for ($y = 0; $y -le 39; $y++) {
|
||||
$Color = 25
|
||||
$row = ""
|
||||
|
@ -65,7 +65,7 @@ function main3 {
|
|||
# ~240 ms
|
||||
function main4 {
|
||||
# This is the same script as gradient.ps1 but hard coded
|
||||
# to 40x160 for nushell comparisions
|
||||
# to 40x160 for nushell comparisons
|
||||
$row = [System.Text.StringBuilder]""
|
||||
for ($y = 0; $y -le 39; $y++) {
|
||||
$Color = 25
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# this script uses foreground ansi index colors to print
|
||||
# a table of 16 rows by 16 colums where each item is a
|
||||
# a table of 16 rows by 16 columns where each item is a
|
||||
# different color
|
||||
def show_index_colors [] {
|
||||
let prefix = "38;5;"
|
||||
|
|
|
@ -20,7 +20,7 @@ def construct_prompt [] {
|
|||
# get the terminal width
|
||||
let term_width = (term size -w)
|
||||
|
||||
# get the curren time
|
||||
# get the current time
|
||||
let current_time = (date now | date format '%I:%M:%S%.3f %p')
|
||||
|
||||
# let's construct the left and right prompt
|
||||
|
@ -39,7 +39,7 @@ def construct_prompt [] {
|
|||
# the right prompt length without the ansi escapes
|
||||
let right_len = ($right_colored | ansi strip | str length)
|
||||
|
||||
# let's calcuate the length of the right prompt so we know how much to pad the left prompt
|
||||
# let's calculate the length of the right prompt so we know how much to pad the left prompt
|
||||
let calculated_right_len = ($term_width - $left_len + ($right_colored_len - $right_len))
|
||||
|
||||
# finally, let's make the prompt
|
||||
|
|
|
@ -29,7 +29,7 @@ def get-latest-linux [] {
|
|||
# update our progress
|
||||
$"Copying files from /tmp/($root_file_name)/*/* to ~/.cargo/bin(char newline)"
|
||||
# this is for testing so it doesn't overwrite my real nu. this should really
|
||||
# be a paremeter
|
||||
# be a parameter
|
||||
mkdir release
|
||||
# construct the copy from and to paths
|
||||
let cp_from_path = $"/tmp/($root_file_name)/*/*"
|
||||
|
|
|
@ -56,7 +56,7 @@ let URL_WEATHER = "https://api.openweathermap.org/data/2.5/weather"
|
|||
def get_weather_by_ip [locIdx: int, units: string] {
|
||||
# units
|
||||
# f = imperial aka Fahrenheit
|
||||
# c = metric aka Celcius
|
||||
# c = metric aka Celsius
|
||||
let coords = (get_location_by_ip $locIdx)
|
||||
if ($coords | length) > 1 {
|
||||
[
|
||||
|
@ -226,7 +226,7 @@ def state_abbrev_lookup [state_name: string] {
|
|||
# > get_weather -l 1
|
||||
# This changes to location 1. Locations are listed in the locations custom command above
|
||||
# > get_weather -l 2 -u c
|
||||
# This uses location 2 and Celcius degrees. f = Fahrenheit, c = Celcius
|
||||
# This uses location 2 and Celsius degrees. f = Fahrenheit, c = Celsius
|
||||
|
||||
# Since I live in the USA I have not tested outside the country.
|
||||
# We'll take PRs for things that are broke or augmentations.
|
|
@ -14,10 +14,10 @@ export extern "btm" [
|
|||
--basic(-b) # Use a more basic look
|
||||
--battery # Show battery widget
|
||||
--case_sensitive(-S) # Enables case sensitivity
|
||||
--celsius(-c) # Sets temp type to celcius
|
||||
--celsius(-c) # Sets temp type to celsius
|
||||
--color: string@colorScheme # Use a pre-defined colorscheme
|
||||
--config(-C): string # Sets the location of the config file
|
||||
--curent_usage(-u) # Set CPU% to current system CPU%
|
||||
--current_usage(-u) # Set CPU% to current system CPU%
|
||||
--default_time_value(-t): int # Time value for graphs
|
||||
--default_widget_count: int # Sets nth selected widget type to use default widget
|
||||
--default_widget_type: string@widgetType # Set default select widget
|
||||
|
@ -37,11 +37,11 @@ export extern "btm" [
|
|||
--network_use_bytes # Network widget as bytes
|
||||
--network_use_logs # Network eidget with logs
|
||||
--process_command # Show processes as commands
|
||||
--rate(-r): int # Sets referesh
|
||||
--rate(-r): int # Sets refresh
|
||||
--regex(-R) # Enable regex by default
|
||||
--show_table_scroll_position # Show scroll position
|
||||
--time-delta(-d): int # Amout changed when zooming in/out
|
||||
--time-delta(-d): int # Amount changed when zooming in/out
|
||||
--tree(-T) # Show processes as tree
|
||||
--version(-V) # Prints version information
|
||||
--whole-word(-w) # Search results match entrie query
|
||||
--whole-word(-w) # Search results match entries query
|
||||
]
|
||||
|
|
|
@ -167,7 +167,7 @@ export extern "cargo clean" [
|
|||
# Build a package's documentation
|
||||
export extern "cargo doc" [
|
||||
--open # Open the docs in a browser after building them
|
||||
--no-deps # Do not build documentation for dependencie
|
||||
--no-deps # Do not build documentation for dependency
|
||||
--document-private-items # Include non-public items in the documentation
|
||||
--package(-p): string@"nu-complete cargo packages" # Document only the specified packages
|
||||
--workspace # Document all members in the workspace
|
||||
|
@ -307,7 +307,7 @@ export extern "cargo test" [
|
|||
|
||||
# Execute benchmarks of a package
|
||||
export extern "cargo bench" [
|
||||
bench_option_seperator?: string
|
||||
bench_option_separator?: string
|
||||
...options: any # Options to be passed to the benchmarks
|
||||
--no-run # Compile, but don't run benchmarks
|
||||
--no-fail-fast # Run all benchmarks regardless of failure
|
||||
|
|
|
@ -23,7 +23,7 @@ extern "curl" [
|
|||
--crlfile # (TLS) Provide a file using PEM format with a Certificate Revocation List
|
||||
--data-ascii # (HTTP) Alias for -d, --data
|
||||
--data-binary # (HTTP) Post data exactly as specified with no processing
|
||||
--data-raw # (HTTP) Post data like --data but without interpeting "@
|
||||
--data-raw # (HTTP) Post data like --data but without interpreting "@
|
||||
--data-urlencode # (HTTP) Post data URL-encoded
|
||||
--data(-d) # (HTTP) Sends the specified data in a POST request to the HTTP server
|
||||
--delegation # (GSS/kerberos) Tell the server how much it can delegate for user creds
|
||||
|
@ -254,7 +254,7 @@ extern "curl PEM, DER ENG P12" [
|
|||
--crlfile # (TLS) Provide a file using PEM format with a Certificate Revocation List
|
||||
--data-ascii # (HTTP) Alias for -d, --data
|
||||
--data-binary # (HTTP) Post data exactly as specified with no processing
|
||||
--data-raw # (HTTP) Post data like --data but without interpeting "@
|
||||
--data-raw # (HTTP) Post data like --data but without interpreting "@
|
||||
--data-urlencode # (HTTP) Post data URL-encoded
|
||||
--data(-d) # (HTTP) Sends the specified data in a POST request to the HTTP server
|
||||
--delegation # (GSS/kerberos) Tell the server how much it can delegate for user creds
|
||||
|
|
|
@ -194,7 +194,7 @@ export extern "git fetch" [
|
|||
--write-fetch-head # Write fetched refs in FETCH_HEAD (default)
|
||||
--no-write-fetch-head # Do not write FETCH_HEAD
|
||||
--force(-f) # Always update the local branch
|
||||
--keep(-k) # Keep dowloaded pack
|
||||
--keep(-k) # Keep downloaded pack
|
||||
--multiple # Allow several arguments to be specified
|
||||
--auto-maintenance # Run 'git maintenance run --auto' at the end (default)
|
||||
--no-auto-maintenance # Don't run 'git maintenance' at the end
|
||||
|
@ -266,7 +266,7 @@ export extern "git pull" [
|
|||
export extern "git switch" [
|
||||
switch?: string@"nu-complete git switch" # name of branch to switch to
|
||||
--create(-c) # create a new branch
|
||||
--detach(-d): string@"nu-complete git log" # switch to a commit in a detatched state
|
||||
--detach(-d): string@"nu-complete git log" # switch to a commit in a detached state
|
||||
--force-create(-C): string # forces creation of new branch, if it exists then the existing branch will be reset to starting point
|
||||
--force(-f) # alias for --discard-changes
|
||||
--guess # if there is no local branch which matches then name but there is a remote one then this is checked out
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
extern "less" [
|
||||
--help(-?) # Display help and exit
|
||||
--search-skip-screen(-a) # Search after end of screen
|
||||
--auto-buffers(-B) # Disable automtic buffer allocation
|
||||
--auto-buffers(-B) # Disable automatic buffer allocation
|
||||
--clear-screen(-c) # Repaint from top
|
||||
--CLEAR-SCREEN(-C) # Clear and repaint from top
|
||||
--dumb(-d) # Suppress error for lacking terminal capability
|
||||
|
@ -10,7 +10,7 @@ extern "less" [
|
|||
--QUIT-AT-EOF(-E) # Exit on EOF
|
||||
--force(-f) # Open non-regular files
|
||||
--quit-if-one-screen(-F) # Quit if file shorter than one screen
|
||||
--hilite-search(-g) # Hilight one search target
|
||||
--hilite-search(-g) # Highlight one search target
|
||||
--HILITE-SEARCH(-G) # No search highlighting
|
||||
--ignore-case(-i) # Search ignores lowercase case
|
||||
--IGNORE-CASE(-I) # Search ignores all case
|
||||
|
@ -22,8 +22,8 @@ extern "less" [
|
|||
--LINE-NUMBERS(-N) # Display line number for each line
|
||||
--quiet(-q) # Silent mode
|
||||
--silent # Silent mode
|
||||
--QUIET(-Q) # Completly silent mode
|
||||
--SILENT # Completly silent mode
|
||||
--QUIET(-Q) # Completely silent mode
|
||||
--SILENT # Completely silent mode
|
||||
--raw-control-chars(-r) # Display control chars
|
||||
--RAW-CONTROL-CHARS(-R) # Display control chars, guess screen appearance
|
||||
--squeeze-blank-lines(-s) # Multiple blank lines sqeezed
|
||||
|
@ -46,7 +46,7 @@ extern "less" [
|
|||
extern "less 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19" [
|
||||
--help(-?) # Display help and exit
|
||||
--search-skip-screen(-a) # Search after end of screen
|
||||
--auto-buffers(-B) # Disable automtic buffer allocation
|
||||
--auto-buffers(-B) # Disable automatic buffer allocation
|
||||
--clear-screen(-c) # Repaint from top
|
||||
--CLEAR-SCREEN(-C) # Clear and repaint from top
|
||||
--dumb(-d) # Suppress error for lacking terminal capability
|
||||
|
@ -54,7 +54,7 @@ extern "less 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19" [
|
|||
--QUIT-AT-EOF(-E) # Exit on EOF
|
||||
--force(-f) # Open non-regular files
|
||||
--quit-if-one-screen(-F) # Quit if file shorter than one screen
|
||||
--hilite-search(-g) # Hilight one search target
|
||||
--hilite-search(-g) # Highlight one search target
|
||||
--HILITE-SEARCH(-G) # No search highlighting
|
||||
--ignore-case(-i) # Search ignores lowercase case
|
||||
--IGNORE-CASE(-I) # Search ignores all case
|
||||
|
@ -66,8 +66,8 @@ extern "less 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19" [
|
|||
--LINE-NUMBERS(-N) # Display line number for each line
|
||||
--quiet(-q) # Silent mode
|
||||
--silent # Silent mode
|
||||
--QUIET(-Q) # Completly silent mode
|
||||
--SILENT # Completly silent mode
|
||||
--QUIET(-Q) # Completely silent mode
|
||||
--SILENT # Completely silent mode
|
||||
--raw-control-chars(-r) # Display control chars
|
||||
--RAW-CONTROL-CHARS(-R) # Display control chars, guess screen appearance
|
||||
--squeeze-blank-lines(-s) # Multiple blank lines sqeezed
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# many of the completions run op commands in the background which may prompt addtional verification/unlocks
|
||||
# many of the completions run op commands in the background which may prompt additional verification/unlocks
|
||||
# an OP_ACCOUNT environment variable is recommended to avoid this
|
||||
|
||||
# commented out aliases work when imported with `use` but not `source`
|
||||
|
|
|
@ -10,7 +10,7 @@ export extern "pass update" [
|
|||
--multiline(-m) # Update multiline passwords. If not set, only the first line of a password file is updated.
|
||||
--include(-i): string # Only update the passwords that match a regex.
|
||||
--exclude(-e): string # Do not update the passwords that match a regex.
|
||||
--edit(-E) # Edit the passwords useing the default editor.
|
||||
--edit(-E) # Edit the passwords using the default editor.
|
||||
--force(-f) # Force update.
|
||||
--version(-V) # Show version information.
|
||||
--help(-h) # Print a help message.
|
||||
|
|
|
@ -26,7 +26,7 @@ export extern "reflector" [
|
|||
--score: int # Limit the list to the n servers with the highest score.
|
||||
--number(-n): int # Return at most n mirrors.
|
||||
--protocol(-p): string@"nu-complete protocol" # Match one of the given protocols, e.g. "https" or "ftp". Multiple protocols may be selected using commas (e.g. "https,http") or by passing this option multiple times.
|
||||
--complection-percent: int # Set the minimum completion percent for the returned mirrors. Check the mirrorstatus webpage for the meaning of this parameter. Default value: 100.0.
|
||||
--completion-percent: int # Set the minimum completion percent for the returned mirrors. Check the mirrorstatus webpage for the meaning of this parameter. Default value: 100.0.
|
||||
--isos # Only return mirrors that host ISOs.
|
||||
--ipv4 # Only return mirrors that support IPv4.
|
||||
--ipv6 # Only return mirrors that support IPv6.
|
||||
|
|
|
@ -119,7 +119,7 @@ def scoopShims [] {
|
|||
|
||||
# Windows command line installer
|
||||
export extern "scoop" [
|
||||
alias?: string@scoopCommands # avaible scoop commands and aliases
|
||||
alias?: string@scoopCommands # available scoop commands and aliases
|
||||
--help(-h) # Show help for this command.
|
||||
--version(-v) # Show current scoop and added buckets versions
|
||||
]
|
||||
|
@ -357,7 +357,7 @@ export extern "scoop config NO_JUNCTIONS" [
|
|||
value?: string@scoopBooleans
|
||||
]
|
||||
|
||||
# Git repository containining scoop source code.
|
||||
# Git repository containing scoop source code.
|
||||
export extern "scoop config SCOOP_REPO" [
|
||||
value?: string@scoopRepos
|
||||
]
|
||||
|
@ -457,7 +457,7 @@ export extern "scoop config aria2-retry-wait" [
|
|||
value?: number
|
||||
]
|
||||
|
||||
# Number of connections used for downlaod.
|
||||
# Number of connections used for download.
|
||||
export extern "scoop config aria2-split" [
|
||||
value?: number
|
||||
]
|
||||
|
@ -467,7 +467,7 @@ export extern "scoop config aria2-max-connection-per-server" [
|
|||
value?: number
|
||||
]
|
||||
|
||||
# Downloaded files will be splitted by this configured size and downloaded using multiple connections.
|
||||
# Downloaded files will be split by this configured size and downloaded using multiple connections.
|
||||
export extern "scoop config aria2-min-split-size" [
|
||||
value?: string
|
||||
]
|
||||
|
|
|
@ -1974,7 +1974,7 @@ extern "virsh pool-edit" [
|
|||
|
||||
# Storage pool information
|
||||
extern "virsh pool-info" [
|
||||
--bytes # Reture pool info in bytes
|
||||
--bytes # Return pool info in bytes
|
||||
...args
|
||||
]
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ def "nu-complete yarn npm audit severity" [] {
|
|||
export extern "yarn npm audit" [
|
||||
--all(-A) # Audit dependencies from all workspaces
|
||||
--recursive(-R) # Audit transitive dependencies as well
|
||||
--enviorment: string # Which enviorments to cover
|
||||
--environment: string # Which environments to cover
|
||||
--json # Format the output as an NDJSON stream
|
||||
--severity: string@"nu-complete yarn npm audit severity" # Minimal severity requested for packages to be displayed
|
||||
]
|
||||
|
@ -343,7 +343,7 @@ export extern "yarn plugin import" [
|
|||
plugin: string@"nu-complete yarn plugin import"
|
||||
]
|
||||
|
||||
# List the avalible offical plugins.
|
||||
# List the available official plugins.
|
||||
export extern "yarn plugin list" [
|
||||
--json # Format the output as an NDJSON stream
|
||||
]
|
||||
|
@ -410,7 +410,7 @@ export extern "yarn search" []
|
|||
|
||||
export extern "yarn set" []
|
||||
|
||||
# Enfore a package resolution
|
||||
# Enforce a package resolution
|
||||
export extern "yarn set resolution" [
|
||||
--save(-s) # Persist the resolution inside the top-level manifest
|
||||
descriptor: string
|
||||
|
@ -553,7 +553,7 @@ export extern "yarn workspaces foreach" [
|
|||
...commandName: string
|
||||
]
|
||||
|
||||
# List all avalible workspaces
|
||||
# List all available workspaces
|
||||
export extern "yarn workspaces list" [
|
||||
--since # Only include workspaces that have been changed since the specified ref.
|
||||
--recursive(-R) # Find packages via dependencies/devDependencies instead of using the workspaces field
|
||||
|
|
|
@ -127,7 +127,7 @@ export extern "zellij action rename-tab" [
|
|||
export extern "zellij action new-tab" [
|
||||
--cwd(-c): path # Change the working directory of the new tab
|
||||
--help(-h) # Print help information
|
||||
--layout(-l): string@"nu-complete zellij layouts" # Layout ot use for the new tab
|
||||
--layout(-l): string@"nu-complete zellij layouts" # Layout to use for the new tab
|
||||
--layout-dir: path # Default folder to look for layouts
|
||||
--name(-n): string # Name for the tab
|
||||
]
|
||||
|
|
|
@ -7,7 +7,7 @@ export def egd [...rest] {
|
|||
with-env [GIT_EXTERNAL_DIFF 'difft'] { git diff $rest }
|
||||
}
|
||||
|
||||
# we need to export the env we create witk load-env
|
||||
# we need to export the env we create with load-env
|
||||
# because we are `use`-ing here and not `source`-ing this file
|
||||
export-env {
|
||||
load-env {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# example usage: get_pr_counts true
|
||||
# If true is provided as an argument, the script will also generate CSV files for each
|
||||
# repo with one line per commit, username, email, date in order for you to figure out
|
||||
# if you need to update the mailmap file so you can merge mutliple users into one.
|
||||
# if you need to update the mailmap file so you can merge multiple users into one.
|
||||
# If false is provided as an argument, the script will summarize the PR counts and
|
||||
# display a table with the top 50 rows.
|
||||
# Whether you run in debug_csv mode or not, the output is written to csv files in the
|
||||
|
|
|
@ -105,7 +105,7 @@ by opening PRs against the `release-notes-($version)` branch.
|
|||
log info "writing release note"
|
||||
$release_note | save --force $blog_path
|
||||
|
||||
log info "commiting release note"
|
||||
log info "committing release note"
|
||||
git -C $repo add $blog_path
|
||||
git -C $repo commit -m $"($title)\n\n($body)"
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ An extensive example of a wrapper for docker operations, with nushell completion
|
|||
|
||||
- [bm](./filesystem/bm.nu) - A Simple bookmarking module. It uses `XGD_DATA_HOME` to save bookmarks.
|
||||
- [expand](./filesystem/expand.nu) - expansion module that implements bashes brace expansion.
|
||||
The expansion uses a list inside of braces seperated by `,` to expand into a list of multiple string variations like:
|
||||
The expansion uses a list inside of braces separated by `,` to expand into a list of multiple string variations like:
|
||||
```
|
||||
expand a/{b,c}/d{e,f,g}.nu{,on}
|
||||
```
|
||||
|
|
|
@ -50,7 +50,7 @@ with-env { FOO: ($foo | to json) } {
|
|||
|
||||
### How can I reuse custom commands in a background task?
|
||||
|
||||
You can define these commands in a seperate module, like so:
|
||||
You can define these commands in a separate module, like so:
|
||||
|
||||
```nu
|
||||
# --- in foo.nu ---
|
||||
|
@ -65,4 +65,4 @@ task spawn {
|
|||
```
|
||||
## Troubleshooting
|
||||
|
||||
- On some setups (e.g. NixOS with `nu` installed as a binary in user's `$HOME`), `sh` (which `pueue` delegates tasks to run) might fail to find `nu` in the `$PATH`. In this case hard-coding the location of your nu binary in the `task spawn` function definiton in `task.nu` can solve the issue.
|
||||
- On some setups (e.g. NixOS with `nu` installed as a binary in user's `$HOME`), `sh` (which `pueue` delegates tasks to run) might fail to find `nu` in the `$PATH`. In this case hard-coding the location of your nu binary in the `task spawn` function definition in `task.nu` can solve the issue.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# grabs the repo name of a github (ORG/repo) string
|
||||
#
|
||||
# for exaple
|
||||
# for example
|
||||
# grab repo name "organization/my_special_repo"
|
||||
# returns "myspecial_repo"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
# A bash like quick string manipulation script
|
||||
# the script works by creating a list from brace contents, seperated by a brace.
|
||||
# the script works by creating a list from brace contents, separated by a brace.
|
||||
|
||||
# Expand the given string into a list on braces like bashes brace expansion
|
||||
export def main [
|
||||
|
@ -38,8 +38,8 @@ export def help [] {
|
|||
$"(ansi green)Examples(ansi reset):"
|
||||
$" > (ansi light_green)expand (ansi green)a/{b,c}/d(ansi reset)"
|
||||
$"╭───┬───────╮\n│ 0 │ a/b/d │\n│ 1 │ a/c/d │\n╰───┴───────╯"
|
||||
$" > (ansi light_green)expand (ansi green)\"my {beautifull,ugly} duckling\"(ansi reset)"
|
||||
$"╭───┬────────────────────────╮\n│ 0 │ my beautifull duckling │\n│ 1 │ my ugly duckling │\n╰───┴────────────────────────╯"
|
||||
$" > (ansi light_green)expand (ansi green)\"my {beautiful,ugly} duckling\"(ansi reset)"
|
||||
$"╭───┬────────────────────────╮\n│ 0 │ my beautiful duckling │\n│ 1 │ my ugly duckling │\n╰───┴────────────────────────╯"
|
||||
$" > (ansi light_green)expand (ansi green).config/nushell/config.nu{,on}(ansi reset)"
|
||||
$"╭───┬─────────────────────────────╮\n│ 0 │ .config/nushell/config.nu │\n│ 1 │ .config/nushell/config.nuon │\n╰───┴─────────────────────────────╯"
|
||||
$" > (ansi light_green)expand (ansi green)a/{b,c}/{d,e,f,g} (ansi reset)(ansi purple)|(ansi reset)(ansi light_green) each(ansi reset) (ansi light_green){ |d| (ansi reset)(ansi light_green) mkdir(ansi reset) (ansi purple)$d (ansi reset)(ansi light_green)}(ansi reset);(ansi light_green)tree(ansi reset)"
|
||||
|
|
|
@ -91,7 +91,7 @@ export def isleap [year: int] {
|
|||
if ( (($year mod 4) == 0 and ($year mod 100) != 0) or ($year mod 400) == 0 ) { echo "It is a leap year." } else { echo "It is not a leap year."}
|
||||
}
|
||||
|
||||
#Greatest common divisior (gcd) between 2 integers
|
||||
#Greatest common divisor (gcd) between 2 integers
|
||||
export def gcd [a: int, b:int] {
|
||||
if $a < $b {
|
||||
gcd $b $a
|
||||
|
|
|
@ -8,7 +8,7 @@ These scripts should be used to draw a custom command prompt in nushell. They ca
|
|||
|
||||
File is in [starship](./starship.nu)
|
||||
|
||||
This discribe how to use starship to make a leftprompt, the repo of starship is [here](https://github.com/starship/starship).
|
||||
This describe how to use starship to make a leftprompt, the repo of starship is [here](https://github.com/starship/starship).
|
||||
|
||||
This script set the output of starship as leftprompt
|
||||
|
||||
|
@ -18,7 +18,7 @@ This script set the output of starship as leftprompt
|
|||
|
||||
File is in [shell_space](./shell_space.nu)
|
||||
|
||||
Use the function of shells in nu, you can view the fucntion with the command following
|
||||
Use the function of shells in nu, you can view the function with the command following
|
||||
|
||||
```
|
||||
help shells
|
||||
|
|
|
@ -20,7 +20,7 @@ def even [n: int, acc=true] -> any {
|
|||
}
|
||||
|
||||
|
||||
# Returns true if number is odd. Will cooperate with even in a mutually recursive fashon.
|
||||
# Returns true if number is odd. Will cooperate with even in a mutually recursive fashion.
|
||||
# Warning: do not pass any numbers less than 0
|
||||
def odd [n: int, acc=true] -> bool {
|
||||
if $n == 0 { return (not $acc) } else if $n == 1 {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Euclid's algorythm for determining greatest common divisor between 2 positive integers
|
||||
# Baed on this clear explanation from Rutgers: https://sites.math.rutgers.edu/~greenfie/gs2004/euclid.html
|
||||
# Euclid's algorithm for determining greatest common divisor between 2 positive integers
|
||||
# Based on this clear explanation from Rutgers: https://sites.math.rutgers.edu/~greenfie/gs2004/euclid.html
|
||||
|
||||
# Returns the GCD of its 2 arguments
|
||||
def gcd [i1: int, i2: int] -> int {
|
||||
|
|
|
@ -101,7 +101,7 @@ def check-if-env-exists [ env_name: string, conda_info: record ] {
|
|||
|
||||
let en = ($env_dirs | each {|en| $conda_info.envs | where $it == $en } | where ($it | length) == 1 | flatten)
|
||||
if ($en | length) > 1 {
|
||||
error make --unspanned {msg: $"You have enviroments in multiple locations: ($en)"}
|
||||
error make --unspanned {msg: $"You have environments in multiple locations: ($en)"}
|
||||
}
|
||||
if ($en | length) == 0 {
|
||||
error make --unspanned {msg: $"Could not find given environment: ($env_name)"}
|
||||
|
|
|
@ -122,7 +122,7 @@ def check-if-env-exists [ env_name: string, conda_info: record ] {
|
|||
|
||||
let en = ($env_dirs | each {|en| $conda_info.envs | where $it == $en } | where ($it | length) == 1 | flatten)
|
||||
if ($en | length) > 1 {
|
||||
error make --unspanned {msg: $"You have enviroments in multiple locations: ($en)"}
|
||||
error make --unspanned {msg: $"You have environments in multiple locations: ($en)"}
|
||||
}
|
||||
if ($en | length) == 0 {
|
||||
error make --unspanned {msg: $"Could not find given environment: ($env_name)"}
|
||||
|
|
|
@ -56,7 +56,7 @@ def show-error [msg label err] {
|
|||
def get_weather_by_ip [locIdx: int, units: string, token: string] {
|
||||
# units
|
||||
# f = imperial aka Fahrenheit
|
||||
# c = metric aka Celcius
|
||||
# c = metric aka Celsius
|
||||
let URL_WEATHER = "https://api.openweathermap.org/data/2.5/weather"
|
||||
let URL_FORECAST = "http://api.openweathermap.org/data/2.5/forecast/daily"
|
||||
let coords = (get_location_by_ip $locIdx $token)
|
||||
|
@ -300,7 +300,7 @@ def get_emoji_by_id [id] {
|
|||
# > get_weather -l 1
|
||||
# This changes to location 1. Locations are listed in the locations custom command above
|
||||
# > get_weather -l 2 -u c
|
||||
# This uses location 2 and Celcius degrees. f = Fahrenheit, c = Celcius
|
||||
# This uses location 2 and Celsius degrees. f = Fahrenheit, c = Celsius
|
||||
|
||||
# Since I live in the USA I have not tested outside the country.
|
||||
# We'll take PRs for things that are broke or augmentations.
|
||||
|
@ -309,5 +309,5 @@ def get_emoji_by_id [id] {
|
|||
# put this in your config.nu file
|
||||
# use /path/to/get-weather.nu get_weather
|
||||
#
|
||||
# then from the nushell commmand prompt type
|
||||
# then from the nushell command prompt type
|
||||
# get_weather
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# 2. if the interval has not expired yet, it prints the Cached information
|
||||
# 3. if the interval has expired, it runs the weather command again and caches the info
|
||||
|
||||
# this script is depenedent on get-weather
|
||||
# this script is dependent on get-weather
|
||||
source get-weather.nu
|
||||
|
||||
#command to run at interval
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# I wrote this so I could have weather in my prompt but not pay the price of hitting
|
||||
# the web for every prompt.
|
||||
|
||||
# this script is depenedent on get-weather
|
||||
# this script is dependent on get-weather
|
||||
use get-weather.nu get_weather
|
||||
|
||||
# Create a mutable weather table to hold the weather data
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Weather Script based on IP Address
|
||||
# - Weather using dark weather api
|
||||
# - Air polution condition using airvisual api
|
||||
# - Air pollution condition using airvisual api
|
||||
# - Street address using google maps api
|
||||
# - Version 2.0
|
||||
export def --env weatherds [] {
|
||||
|
@ -62,7 +62,7 @@ def get_airCond [loc] {
|
|||
let url = $"https://api.airvisual.com/v2/nearest_city?lat=($lat)&lon=($lon)&key=($apiKey)"
|
||||
let aqius = (http get $url).data.current.pollution.aqius
|
||||
|
||||
# clasification (standard)
|
||||
# classification (standard)
|
||||
if $aqius < 51 { "Good" } else if $aqius < 101 { "Moderate" } else if $aqius < 151 { "Unhealthy for some" } else if $aqius < 201 { "Unhealthy" } else if $aqius < 301 { "Very unhealthy" } else { "Hazardous" }
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# 2. add to your config.nu: `source .config/nushell/autojump.nu`
|
||||
#
|
||||
# Usage
|
||||
# Run `j` to jump arround
|
||||
# Run `j` to jump around
|
||||
|
||||
def autojump_add_to_database [dir] {
|
||||
$env.AUTOJUMP_SOURCED = 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let appID = "" #YOUR APP_ID
|
||||
|
||||
#Fetch simple anwser from WolframAlpha API
|
||||
#Fetch simple answer from WolframAlpha API
|
||||
def wolfram [...query #Your query
|
||||
] {
|
||||
let query_string = ($query | str join " ")
|
||||
|
@ -8,7 +8,7 @@ def wolfram [...query #Your query
|
|||
$result + ""
|
||||
}
|
||||
|
||||
#Fetch image with full anwser from WolframAlpha API
|
||||
#Fetch image with full answer from WolframAlpha API
|
||||
def wolframimg [...query #Your query
|
||||
] {
|
||||
let query_string = ($query | str join " ")
|
||||
|
|
|
@ -323,7 +323,7 @@ def trans [
|
|||
--from:string #from which language you are translating (default english)
|
||||
--to:string #to which language you are translating (default spanish)
|
||||
#
|
||||
#Use ISO standar names for the languages, for example:
|
||||
#Use ISO standard names for the languages, for example:
|
||||
#english: en-US
|
||||
#spanish: es-ES
|
||||
#italian: it-IT
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
# Convert Fahrenheit to Celcius
|
||||
# Convert Fahrenheit to Celsius
|
||||
export def f-to-c [
|
||||
fahren: number # Degrees Fahrenheit
|
||||
--round(-r): int = 2 # Digits of precision to round to
|
||||
] {
|
||||
# (100°F − 32) × 5/9 = 37.778°C
|
||||
let $n = if ($fahren | describe) == "float" {$fahren} else {$fahren | into float }
|
||||
let celcius = ((( $n - 32.) * 5 / 9. ) | math round -p $round )
|
||||
$"($fahren) °F is ($celcius) °C"
|
||||
let celsius = ((( $n - 32.) * 5 / 9. ) | math round -p $round )
|
||||
$"($fahren) °F is ($celsius) °C"
|
||||
}
|
||||
|
||||
# Convert Fahrenheit to Kelvin
|
||||
|
@ -22,29 +22,29 @@ export def f-to-k [
|
|||
$"($fahren) °F is ($kelvin) °K"
|
||||
}
|
||||
|
||||
# Convert Celcius to Fahrenheit
|
||||
# Convert Celsius to Fahrenheit
|
||||
export def c-to-f [
|
||||
celcius: number # Degrees Celcius
|
||||
celsius: number # Degrees Celsius
|
||||
--round(-r): int = 2 # Digits of precision to round to
|
||||
] {
|
||||
# (100°C × 9/5) + 32 = 212°F
|
||||
|
||||
let $n = if ($celcius | describe) == "float" {$celcius} else {$celcius | into float }
|
||||
let $n = if ($celsius | describe) == "float" {$celsius} else {$celsius | into float }
|
||||
let fahren = ((($n * 9 / 5) + 32) | math round -p $round )
|
||||
$"($celcius) °C is ($fahren) °F"
|
||||
$"($celsius) °C is ($fahren) °F"
|
||||
}
|
||||
|
||||
# Convert Celcius to Kelvin
|
||||
# Convert Celsius to Kelvin
|
||||
export def c-to-k [
|
||||
celcius: number # Degrees Celcius
|
||||
celsius: number # Degrees Celsius
|
||||
--round(-r): int = 2 # Digits of precision to round to
|
||||
] {
|
||||
# 100°C + 273.15 = 373.15K
|
||||
|
||||
|
||||
let $n = if ($celcius | describe) == "float" {$celcius} else {$celcius | into float }
|
||||
let $n = if ($celsius | describe) == "float" {$celsius} else {$celsius | into float }
|
||||
let kelvin = (($n + 273.15) | math round -p $round )
|
||||
$"($celcius) °C is ($kelvin) °K"
|
||||
$"($celsius) °C is ($kelvin) °K"
|
||||
}
|
||||
|
||||
# Convert Kelvin to Fahrenheit
|
||||
|
@ -59,14 +59,14 @@ export def k-to-f [
|
|||
$"($kelvin) °K is ($fahren) °F"
|
||||
}
|
||||
|
||||
# Convert Kelvin to Celcius
|
||||
# Convert Kelvin to Celsius
|
||||
export def k-to-c [
|
||||
kelvin:number # Degrees Celcius
|
||||
kelvin:number # Degrees Celsius
|
||||
--round(-r): int = 2 # Digits of precision to round to
|
||||
] {
|
||||
# 100K − 273.15 = -173.1°C
|
||||
|
||||
let $n = if ($kelvin | describe) == "float" {$kelvin} else {$kelvin | into float }
|
||||
let celcius = (($n - 273.15) | math round -p $round )
|
||||
$"($kelvin) °K is ($celcius) °C"
|
||||
let celsius = (($n - 273.15) | math round -p $round )
|
||||
$"($kelvin) °K is ($celsius) °C"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ let token = (
|
|||
|
||||
for $twitter_username in $usernames {
|
||||
|
||||
#getting all the usefull data from the api
|
||||
#getting all the useful data from the api
|
||||
|
||||
let variables = {
|
||||
screen_name: $twitter_username,
|
||||
|
|
12
typos.toml
Normal file
12
typos.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
[default.extend-words]
|
||||
Darcula = "Darcula" # theme name
|
||||
aci = "aci" # theme name
|
||||
ba = "ba" # variable example, i guess it would be better to rename variable
|
||||
nd = "nd" # in second
|
||||
claus = "claus" # claus in emojis
|
||||
Claus = "Claus" # claus in emojis
|
||||
iterm = "iterm"
|
||||
grup = "grup" # git alias
|
||||
|
||||
[files]
|
||||
extend-exclude = ['*.png', 'password_generator', 'auto-generate', 'remove-diacritics.nu']
|
Loading…
Add table
Add a link
Reference in a new issue