Merge pull request #10 from fdncred/main

updated readme, added a few scripts and emoji sample data
This commit is contained in:
Darren Schroeder 2021-01-30 11:17:00 -06:00 committed by GitHub
commit 9a78659854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14787 additions and 3 deletions

View File

@ -4,6 +4,27 @@ This is a place to share Nushell scripts with each other. If you'd like to share
## Included Scripts
| File | Nu version | Description |
| ---- | ---------- | ---------- |
| [fehbg.nu](./fehbg.nu) | >0.25.1 | Sets a random image from a directory as a wallpaper (Linux only) |
| Category | File | Nu Version | Description |
| ---------------- | --------------------------------------------------------- | ---------- | ----------- |
| coloring | [color_table.nu](./coloring/color_table.nu) | 0.26 | Produces a color table of ansi foregroupd and background colors. |
| coloring | [color_tables.nu](./coloring/color_tables.nu) | 0.26 | Produces many tables with ansi foreground and background with styles |
| coloring | [gradient.nu](./coloring/gradient.nu) | 0.26 | Draws a simple blue gradient. |
| coloring | [nu_index_bg.nu](./coloring/nu_index_bg.nu) | 0.26 | Draws background colors using ansi escape sequences using an index |
| coloring | [nu_index_fg.nu](./coloring/nu_index_fg.nu) | 0.26 | Draws foreground colors using ansi escape sequences using an index |
| coloring | [nu_index_fg2.nu](./coloring/nu_index_fg2.nu) | 0.26 | Draws foreground colors using ansi escape sequences using an index a different way |
| coloring | [python_index_table.nu](./coloring/python_index_table.nu) | 0.26 | Draws foreground and background colors using ansi escape sequences using an index modeled after a python script |
| coloring | [ref_table.nu](./coloring/ref_table.nu) | 0.26 | A table with row and column headers indicating the colors |
| coloring | [sample.nu](./coloring/sample.nu) | 0.26 | An exhaustive list of colors and styles using ansi escape sequences |
| coloring | [short_list.nu](./coloring/short_list.nu) | 0.26 | A small color sample that uses another nu script to define the colors by name. |
| not assigned yet | [fehbg.nu](./fehbg.nu) | >0.25.1 | Sets a random image from a directory as a wallpaper (Linux only) |
| not assigned yet | [maintainer_time.nu](./maintainer_time.nu) | 0.26 | Looks up time by timezone for the nushell maintainers |
| not assigned yet | [make_readme_table.nu](./make_readme_table.nu) | 0.26 | Generates this table. |
| nu_101 | [demo.nu](./nu_101/demo.nu) | 0.26 | Creates a custom `ls` command |
| nu_101 | [inner_outer_loop.nu](./nu_101/inner_outer_loop.nu) | 0.26 | Demonstrates how to iterate in an inner and outer loop. |
| parsing | [sample_andres.nu](./parsing/sample_andres.nu) | 0.26 | Demonstrates some json parsing. |
| not assigned yet | [percent_meter.nu](./percent_meter.nu) | 0.26 | Draws a percent meter. |
| not assigned yet | [progress_bar.nu](./progress_bar.nu) | 0.26 | Draws a progress bar |
| not assigned yet | [progress_bar_no_back.nu](./progress_bar_no_back.nu) | 0.26 | Draws a progress bar with no background |
| prompt | [myprompt.nu](./prompt/myprompt.nu) | 0.26 | Prototype script to create a prompt. |
| stdlib_candidate | [nu_style.nu](./stdlib_candidate/nu_style.nu) | 0.26 | Define colors as names. |
| stdlib_candidate | [print.nu](./stdlib_candidate/print.nu) | 0.26 | Examples of a print statement. |

7
maintainer_time.nu Normal file
View File

@ -0,0 +1,7 @@
let m_table = $(
echo [['name', 'tz', 'time']; ['andres' 'US/Eastern' ' '] ['fdncred' 'US/Central' ' '] ['gedge' 'US/Eastern' ' '] ['jturner' 'NZ' ' '] ['wycats' 'US/Pacific' ' ']]
)
let now = $(date now)
echo $m_table | update time {
echo $now | date to-timezone $(get tz) | date format '%c'
}

33
make_readme_table.nu Normal file
View File

@ -0,0 +1,33 @@
# A Script to try and create the table for the readme.md file
# | Category | File | Nu Version | Description |
# | ---------------- | --------------------------------------------------------- | ---------- | ----------- |
# | coloring | [color_table.nu](./coloring/color_table.nu) | 0.26 | desc |
# | coloring | [color_tables.nu](./coloring/color_tables.nu) | 0.26 | desc |
# Right now there is still manual manipulation in order to update the README.md
# Hopefully, in the future someone will contribute a script to make this automatic.
let nu_files = $(ls **/*.nu)
let nu_table = $(echo $nu_files |
get name |
wrap File |
insert 'Nu Version' 0.26 |
insert Description desc |
insert Category {
let cat = $(get File | path dirname)
if $cat == "" {
echo "not assigned yet"
} {
echo $cat
}
} | select Category File 'Nu Version' Description)
# Let's fix the file now
let nu_table = $(echo $nu_table | update File {
let file_path = $(get File)
let file_name = $(echo $file_path | path basename)
let file_link = $(build-string "[" $file_name "]" "(./" $file_path ")")
echo $file_link
})
echo $nu_table | to md --pretty

14723
sample_data/gh-emoji.json Normal file

File diff suppressed because it is too large Load Diff