diff --git a/before_v0.60/api_wrappers/wolframalpha.nu b/before_v0.60/api_wrappers/wolframalpha.nu deleted file mode 100644 index 1cbb6b5..0000000 --- a/before_v0.60/api_wrappers/wolframalpha.nu +++ /dev/null @@ -1,19 +0,0 @@ -#Fetch simple anwser from WolframAlpha API -def wolfram [...query #Your query -] { - let appID = #YOUR APP_ID - let query_string = ($query | str collect " ") - let result = (fetch ("https://api.wolframalpha.com/v1/result?" + ([[appid i]; [$appID $query_string]] | to url))) - $result + "" -} - -#Fetch image with full anwser from WolframAlpha API -def wolframimg [...query #Your query -] { - let appID = #YOUR APP_ID - let query_string = ($query | str collect " ") - let filename = ($query_string + ".png") - let link = ("https://api.wolframalpha.com/v1/simple?" + ([[appid i]; [$appID $query_string]] | to url) + "&background=F5F5F5&fontsize=20") - fetch $link | save $filename - echo ("Query result saved in file: " + $filename) -} diff --git a/before_v0.60/cmd_stats.nu b/before_v0.60/cmd_stats.nu deleted file mode 100644 index 4d2fdda..0000000 --- a/before_v0.60/cmd_stats.nu +++ /dev/null @@ -1,20 +0,0 @@ -let filter = ($nu.lang | where is_filter == $true | length) -let builtin = ($nu.lang | where is_builtin == $true | length) -let subcmd = ($nu.lang | where is_sub == $true | length) -let plugin = ($nu.lang | where is_plugin == $true | length) -let custom = ($nu.lang | where is_custom == $true | length) -let private = ($nu.lang | where is_private == $true | length) -let binary = ($nu.lang | where is_binary == $true | length) -let total = ($nu.lang | length) - -[ - [command_type count]; - [filter $filter] - [builtin $builtin] - [sub_command $subcmd] - [plugin $plugin] - [custom $custom] - [private $private] - [binary $binary] - [total_cmds $total] -] \ No newline at end of file diff --git a/misc/cmd_stats.nu b/misc/cmd_stats.nu new file mode 100644 index 0000000..8968ed8 --- /dev/null +++ b/misc/cmd_stats.nu @@ -0,0 +1,18 @@ +let builtin = ($nu.scope.commands | where is_builtin == true | length) +let subcmd = ($nu.scope.commands | where is_sub == true | length) +let plugin = ($nu.scope.commands | where is_plugin == true | length) +let custom = ($nu.scope.commands | where is_custom == true | length) +let keyword = ($nu.scope.commands | where is_keyword == true | length) +let extern = ($nu.scope.commands | where is_extern == true | length) +let total = ($nu.scope.commands | length) + +[ + [command_type count]; + [builtin $builtin] + [sub_command $subcmd] + [plugin $plugin] + [custom $custom] + [keyword $keyword] + [extern $extern] + [total_cmds $total] +] \ No newline at end of file diff --git a/before_v0.60/table_grouping.nu b/misc/table_grouping.nu similarity index 79% rename from before_v0.60/table_grouping.nu rename to misc/table_grouping.nu index ec8148f..6ae9df6 100644 --- a/before_v0.60/table_grouping.nu +++ b/misc/table_grouping.nu @@ -1,37 +1,37 @@ let table = (echo [ - [url user_login title]; + [url user_login title]; [https://api.github.com/repos/nushell/nushell/issues/3382 ammkrn 'Dont unwrap rustyline helper in cli'] - [https://api.github.com/repos/nushell/nushell/issues/3379 jonathandturner 'Simplify down to one type of context'] + [https://api.github.com/repos/nushell/nushell/issues/3379 jonathandturner 'Simplify down to one type of context'] [https://api.github.com/repos/nushell/nushell/issues/3377 kubouch 'Port range to engine-p'] - [https://api.github.com/repos/nushell/nushell/issues/3375 fdncred 'added check for endian-ness, added a bytes and skip'] - [https://api.github.com/repos/nushell/nushell/issues/3374 fdncred 'added ability to change "] - [https://api.github.com/repos/nushell/nushell/issues/3370 fdncred 'add nu-pretty-hex, add into binary, update binaryview'] + [https://api.github.com/repos/nushell/nushell/issues/3375 fdncred 'added check for endian-ness, added a bytes and skip'] + [https://api.github.com/repos/nushell/nushell/issues/3374 fdncred 'added ability to change '] + [https://api.github.com/repos/nushell/nushell/issues/3370 fdncred 'add nu-pretty-hex, add into binary, update binaryview'] [https://api.github.com/repos/nushell/nushell/issues/3367 fdncred 'tweaked the error handling to show specific errors'] ]) # Show what the table looks like -$"This is an example table (char nl)" -$table +print $"This is an example table (char nl)" +print $table -$"This is markdown created from the example table (char nl)" +print $"This is markdown created from the example table (char nl)" # Now show what the table in Markdown looks like -$"## Nushell(char nl)(char nl)" -$table | group-by user_login | pivot user prs | each { |row| +print $"## Nushell(char nl)(char nl)" +print ($table | group-by user_login | transpose user prs | each { |row| let user_name = $row.user let pr_count = (echo $row.prs | length) # only print the comma if there's another item - let user_prs = ($row.prs | each -n { |pr| + let user_prs = ($row.prs | enumerate | each { |pr| if $pr_count == ($pr.index + 1) { - build-string '[' $pr.item.title '](' $pr.item.url ')' - } { - build-string '[' $pr.item.title '](' $pr.item.url '), and ' + echo $'[($pr.item.title)](char lp)($pr.item.url)(char rp)' + } else { + echo $'[($pr.item.title)](char lp)($pr.item.url)(char rp), and ' } - } | str collect) + } | str join) - $"- ($user_name) created ($user_prs) (char nl)" + echo $"- ($user_name) created ($user_prs) (char nl)" -} | str collect +} | str join) # ╭───┬──────────────────────────────────────────────────────────┬─────────────────┬───────────────────────────────────────────────────────╮ # │ # │ url │ user_login │ title │ @@ -47,6 +47,6 @@ $table | group-by user_login | pivot user prs | each { |row| def log [message:any] { let now = (date now | date format '%Y%m%d_%H%M%S.%f') - let mess = (build-string $now '|DBG|' $message (char newline)) - echo $mess | autoview + let mess = ([$now '|DBG|' $message (char newline)] | str join) + echo $mess }