Commit Graph

26 Commits

Author SHA1 Message Date
Igor
275a0f8f26
Port before_v0.60/data_extraction before_v0.60/examples before_v0.60/duplicates (#847)
This PR is part of porting all old scripts #221 and includes a set of
modules:

- `data_extraction`
- `examples` 
- `duplicates`

## 7 changed files:

### `data_extraction`
- `data_extraction/ultimate_extractor.nu`: removed. Has already been
ported to `modules/data_extraction/ultimate_extractor.nu`

### `duplicates`
- `duplicates/duplicates.nu` -> `modules/duplicates/duplicates.nu`
- `duplicates/example.nu` -> `modules/duplicates/example.nu`
- `duplicates/README.md` -> `modules/duplicates/README.md`: unchanged

### `examples`
- `examples/netstat.nu` -> `modules/examples/netstat.nu`
- `examples/date_in_local_timezones.nu` ->
`modules/examples/date_in_local_timezones.nu`
- `befove_v0.60/assets/core_team.nu`: removed. This table has been
embedded into `date_in_local_timezones.nu`
2024-05-26 12:37:29 -05:00
Igor
e8df70a406
Port before_v0.60/fuzzy, before_v0.60/ls-mods and before_v0.60/nu_101 (#845)
This PR is part of porting all old scripts #221 and includes a set of
modules:

- fuzzy -> `modules/fuzzy/fuzzy_command_search.nu`
- ls-mods -> `modules/ls-mods`: `ls-less.nu`, `ls-wide.nu` and
`ls-wide-with-color.nu`
- nu_101 -> `modules/nu_101`: `nothing.nu` and `inner_outer_loop.nu`

Edit: `fuzzy` and `nu_101` have been moved to `sourced`
2024-05-26 12:35:59 -05:00
Igor
2fe0756df9
Port before_v0.60/fun folder (issue #221) (#835)
This PR is part of porting all old scripts #221 and ports `fun` folder

<details><summary>Summary</summary>

### star.nu
```yaml
from: before_v0.60/fun/star.nu
to: modules/fun/star.nu
```

### spark.nu
The script has already been ported. I've removed old version.
```yaml
from: before_v0.60/fun/spark.nu
to: sourced/fun/spark.nu
functions:
  spark: sourced/fun/spark.nu:1:spark
```

### life.nu
```yaml
from: before_v0.60/fun/life.nu
to: modules/fun/life.nu
```

### lisp_mode.nu
There is a problem with this module because `-` is not allowed in names
anymore, however `def "-"` is a valid syntax, but you will be unable to
call this function.
```yaml
from: before_v0.60/fun/lisp_mode.nu
to: sourced/fun/lisp_mode.nu
```


### nyancat.nu
I also fixed animation frames from https://github.com/klange/nyancat
```yaml
from: before_v0.60/fun/nyancat.nu
to: modules/fun/nyancat.nu
```


</details>
2024-05-13 07:55:11 -05:00
Igor
b40ead9ae2
Port before_v0.60/cool_oneliners folder (#831)
This PR is part of porting all old scripts #221 and ports
`cool_oneliners` folder

## Summary

### dict.nu
This script has already been ported to `sourced/cool_oneliners/dict.nu`
in
28c7e097db

```yaml
from: before_v0.60/cool_oneliners/dict.nu
to: sourced/cool-oneliners/dict.nu
functions:
  dict: sourced/cool-oneliners/dict.nu:2:dict
```

### file_cat.nu
has already been ported to `sourced/cool_oneliners/file_cat.nu` in
c47ccd42b8
```yaml
  from: before_v0.60/cool_oneliners/file_cat.nu
  to: sourced/cool-oneliners/file_cat.nu
```

### filesize.nu

```yaml
from: before_v0.60/cool_oneliners/filesize.nu
to: sourced/cool-oneliners/filesize.nu
```

### js_map_to_markdown.nu
```yaml
from: before_v0.60/cool_oneliners/js_map_to_markdown.nu
to:  sourced/cool-oneliners/js_map_to_markdown.nu
```
I created `sourced/cool-oneliners/assets/js_map.json` with the data for
this script as it was before

### cdpath-implementation.nu
```yaml
from: before_v0.60/cool_oneliners/cdpath-implementation.nu
to: sourced/cool-oneliners/cdpath-implementation.nu
functions:
  c: sourced/cool-oneliners/cdpath-implementation.nu:18:c
```

### parse_aws_s3_ls.nu
I don't have aws so I just ported the syntax
```yaml
from: before_v0.60/cool_oneliners/parse_aws_s3_ls.nu
to:  null
```
Edit: I considered not porting this script yet because I can't test it
for now

### npm_update_versions.nu
```yaml
from: before_v0.60/cool_oneliners/npm_update_versions.nu
to: sourced/cool-oneliners/npm_update_versions.nu
```

### xml_search_schema.nu
```yaml
from: before_v0.60/cool_oneliners/xml_search_schema.nu
to: sourced/cool-oneliners/xml_search_schema.nu
```
2024-05-13 07:53:40 -05:00
Maxim Uvarov
afde2592a6
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
2024-05-08 06:47:54 -05:00
Auca Coyan
bc6273d971
🐛 fix a couple of parser errors (#782)
This is some legwork to the CI
- [x] fix one `get-row.nu` before 0.60, just because it was easy
- [x] `modules/formats/to-ini.nu`
- [x] `modules/git/git-v2.nu`
- [x] `modules/git/git.nu`
- [x] `modules/log/log.nu`
- [x] `modules/weather/weatherdark.nu`
- [x] `sourced/api_wrappers/worlframalpha.nu`
- [x] `sourced/cool-oneliners/pwd-short.nu`
- [x] `sourced/github/branch-protections/branch-protections.nu`
- [x] `sourced/gitlab/gitlab.nu`
- [x] `sourced/misc/nu_defs.nu`
- [x] `sourced/update-path.nu`
- [x] `sourced/webscraping/shell_starts.nu`
I moved some auto-generated commands:
- [x] `ack` 
- [x] `as`
- [x] `curl`
- [x] `fsarprc`
- [x] `fsarpri`
- [x] `godoc`
- [x] `mysql` 
- [x] and `xgettext` 
to custom, so we keep the modifications.
I had to comment some of the flags because the parser is not able to
parse some flags. Those are explained in comments
2024-03-10 14:05:01 -05:00
TWSiO
66aa80064e
Adding some examples of how to treat a list like other data structures. (#733)
A nu_101 script to give some examples of how to treat lists like other
data structures that nushell doesn't have natively. Namely queues,
stacks, and sets (and multisets sort of).

I'm also considering making some examples for trees and graphs, probably
using tables, although I might put them in another script so it doesn't
get too long.
2024-01-11 13:33:48 -06:00
TWSiO
2d9e279ad8
Adding http oneliner and changing reference to renamed Discord channel. (#731)
The [cookbook intro page](https://www.nushell.sh/cookbook/) gives an
example of a oneliner that I recently changed to imply is one of the
oneliners from this repo (nushell/nushell.github.io#1205), however that
oneliner isn't actually in this repo. This adds that oneliner to the
repo.

I also replaced the mention of the \#cool-oneliners channel that was
renamed to \#cool-scripts to just mention the general Nushell community.
2024-01-10 22:11:44 +02:00
Stefan Holderbach
3836e70d68
Change uses of size to str stats (#647)
Deprecation will be released with `0.87`
- ~~https://github.com/nushell/nushell/pull/10772~~
- https://github.com/nushell/nushell/pull/10798

Final removal in `0.88`


Land before: 
- https://github.com/nushell/nushell/pull/10784
2023-12-06 18:27:41 +01:00
WindSoilder
06d3095ab1
Using def --env instead of def-env (#673) 2023-11-20 06:55:35 -06:00
Antoine Stevan
ed9165fda1
fix removed commands (#645)
related to
- https://github.com/nushell/nushell/pull/10567
- https://github.com/nushell/nushell/pull/10668
- https://github.com/nushell/nushell/pull/10568

this PR removes mentions to removed commands from
https://github.com/nushell/nushell/pull/10567,
https://github.com/nushell/nushell/pull/10668 and
https://github.com/nushell/nushell/pull/10568.

the main change has been introduced with
```nushell
sd 'random integer' 'random int' **/*.nu
```

running `rg "$nothing|random integer|to xml .* --pretty"` gives
- before
```
modules/random-list/random-list.nu
85:# Generate a random integer list.
95:        random integer $range

modules/fun/wordle.nu
11:  let word = ($words | get (random integer 0..($words | length)) | get column1)

benchmarks/random-bytes.nu
5:        | each { random integer }

sourced/misc/password_generator/ReadMe.md
84:Obviously you can just use the `random chars` or `random integers` commands but I like to have words I can read in my passwords, and I think those generated by this script have sufficient entropy.

sourced/misc/password_generator/nupass.nu
43:  let random_numbers = (1..$words | par-each { |i| (random integer 0..99) } --threads $threads)
71:    return (0..($words - 1) | each { |it| (random integer 0..99 | into string) + ($random_words | get $it) } | reduce { |it
, acc| $acc + $it })
92:    | get (random integer 1..($numlines))
99:        let rint = (random integer 1..4)
119:    | get (random integer 0..($symbolcharslen - 1))
```
- after
```
modules/random-list/random-list.nu
85:# Generate a random integer list.

sourced/misc/password_generator/ReadMe.md
84:Obviously you can just use the `random chars` or `random integers` commands but I like to have words I can read in my passwords, and I think those generated by this script have sufficient entropy.
```
2023-10-19 19:35:23 +02:00
Eric Hodel
c93ce14fc9
Improved CDPATH (#644)
This updated `c` command supports:
* Changing to the previous directory with `c -`
* Changing to absolute directories
* Completion of CDPATH entries
* Completion of absolute paths
* Completion of children

When completing CDPATH entries the parent directory is shown to provide
context in case multiple CDPATH entries have the same child directory
names.

Fixes #244
2023-10-19 06:35:32 -05:00
Stefan Holderbach
6947014306
Replace use of $nothing with null (#621)
`$nothing` will be deprecated in nu 0.86

This accompanies
- https://github.com/nushell/nushell/pull/10478
2023-09-26 18:52:49 +02:00
baehyunsol
79fcd05525
use repeat instead of string multiplication (#612) 2023-09-21 13:20:49 +02:00
Stefan Holderbach
36a45f28a3
Move random/into decimal to random/into float (#606)
* Move `random-list decimal` to `random-list float`

Updates internally to `random float` published with `0.85`

* Update kubernetes wrapper to `into float`

* Update temp script to `into float`

* Update `nupass` to `random float`
2023-09-20 19:13:52 +02:00
Antoine Stevan
cfd7a7950b
add a typeof command (#597)
* add the `typeof` command

* add some tests
2023-09-10 08:13:04 -05:00
Maxim Uvarov
5ed3a961af
Update bar function (#589)
* fix indexing issue

* [bar] make default output without ansi codes

* [bar] use actual testing framework
2023-09-01 07:18:21 -05:00
Antoine Stevan
be47e43db6
rename date format to format date (#571) 2023-08-04 09:08:10 -05:00
Antoine Stevan
a61256da0e
use $env. instead of let-env (#543)
related to nushell/nushell#9574

Commands used
```nushell
sd --string-mode "let-env " '$env.' **/*
git rst before_v0.60/
```
2023-07-01 10:40:16 +02:00
Kenichi Kamiya
0ca38a46f5
Replace deprecated hash base64 with decode (#531)
Applied in https://github.com/nushell/nushell/issues/5861
2023-06-15 06:14:41 -05:00
Kenichi Kamiya
28c7e097db
Replace deprecated fetch with http get (#530)
Applied in https://github.com/nushell/nushell/pull/7796
2023-06-15 06:13:39 -05:00
Maxim Uvarov
b2fadc0ea8
the function to display bars of given percentage from given width (#478)
* function to display bars of given percentage from given width

* adding --progress, moving width to options

thanks @amtoine

* typos of ESL studnet

* added examples and tests

* feat(nano): add completions (#479)

* feat(nano): add completions

* feat(nano): add readme

* removed escape symbols from tests, fixed fraction indexing

* fixed tests

Fixed tests, although they need escape sequences, as the bar function has the ability to change the colors of both the background and foreground and uses the default color by default.

* Rename bar_fn.nu to bar.nu

---------

Co-authored-by: Emily Grace Seville <EmilySeville7cfg@gmail.com>
2023-05-12 09:11:20 -05:00
Rick Cogley
f02f4dd0d0
Nupass par each threads 20230504 (#477)
* Update ReadMe.md

Added explanation of how to use new --threads switch to feed to the par-each loops

* Update nupass.nu

Added --threads flag to allow setting of same in par-each loops, for performance fine tuning
2023-05-04 08:00:38 -05:00
Rick Cogley
afba27f304
Nupass performance 20230502 (#474)
* Use par-each in main list builders

Using par-each on the main list builders for random words, symbols and numbers results in a significant performance gain

* Add benchmarking section

Explain how par-each really can improve performance
2023-05-02 06:39:33 -05:00
Rick Cogley
112d8b2f7e
Nupass refactor 20230501 (#473)
* Refactor nupass.nu

Major refactor for more flexibility

To allow number of words to be specified, one solution is to add random 
words, symbols, & numbers to lists, then operate on the lists.
You can combine lists with the ++ operator, then use shuffle on them,
as well as various other methods.

* Update ReadMe.md

Updated to match latest version, adding some new sample commands

Last version `nupass 4` meant "generate password with 3 words of length <=4".
This version `nupass 4` means "generate password with 4 words".
Length can be specified with `-l`, so: `nupass 4 -l 8` means "generate password with 4 words of length <=8".

* Update ReadMe.md

Screenshot showing new version's output
2023-05-01 06:10:19 -05:00
Mel Massadian
c47ccd42b8
refactor: (#418)
* refactor:  move in one commit

Eveything in modules should probably be changed to `exported` defs.
The idea is to move everything first to keep proper history.

* refactor: 📝 add modules readme (wip)

* refactor:  small move

* refactor: 📝 changed nestring, updated modules readme

* refactor: 📝 to document or not to document

* fix: 🐛 themes

replaced the template to use `main` and regenerated them
from lemnos themes.

* Revert "fix: 🐛 themes"

This reverts commit 4918d3633c.

* refactor:  introduce sourced

- Created a source `root` in which sourcable demos are stored.
  Some might get converted to modules later on.
- Moved some files to bin too.

* fix: 🐛 fehbg.nu

* fix: 🐛 modules/after.nu

* moved some other stuff around

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-04-25 17:56:25 -05:00