Skip to content

Instantly share code, notes, and snippets.

@paul-d-ray
paul-d-ray / Nushell_Get_SHA256_Hash.md
Created December 3, 2025 00:31
Nushell Get SHA256 Hash for a list of files

Purpose

Get the SHA256 Hast for a list of files. This can be used to compare to the hast of a downloaded file.

Nushell Code

nuls -f d:/work/tools | where name =~ '^nu'| sort-by modified | select fullname |
each {|file| {fullname: $file.fullname, hash: (open $file.fullname --raw | hash sha256)} } | collect
@paul-d-ray
paul-d-ray / Nushell_Rossetta_Merge_and_Aggregate_Datasets.md
Last active November 23, 2025 00:41
Nushell Merge and Aggregate Datasets

Merge and aggregate datasets

From Roseeta Code Merge and aggregate datasets Task

  • Merge and aggregate two datasets as provided in .csv files into a new resulting dataset.

  • Use the appropriate methods and data structures depending on the programming language.

  • Use the most common libraries only when built-in functionality is not sufficient.

    • Note Either load the data from the .csv files or create the required data structures hard-coded.
@paul-d-ray
paul-d-ray / Nushell_config.nu
Last active November 23, 2025 00:46
Nushell Config.nu
# config.nu
#
# Installed by:
# version = "0.102.0"
#
# This file is used to override default Nushell settings, define
# (or import) custom commands, or run any other startup tasks.
# See https://www.nushell.sh/book/configuration.html
#
# This file is loaded after env.nu and before login.nu
@paul-d-ray
paul-d-ray / Visidata_Nushell_Join_Data_Sets.md
Created October 11, 2025 22:36
Visidata Nushell Join two data sets
@paul-d-ray
paul-d-ray / Visidata_DateTime_Column.md
Created October 11, 2025 22:33
Visidata DateTime column Filter or Split

Filter on a Date Column

to filer on a date field do the following steps

  • make sure the import datetime is in the .visidatarc file.
  • format the date column with @ to let visidata know it is a date column.
  • be in the column, and do a filter z|
  • key in the command
    DATE_FIELD_NAME > datetime.date(YYYY,M,D)
    INCIDENT_DATE > datetime.date(2016,1,1)
@paul-d-ray
paul-d-ray / Visidata_Visidatarc.md
Last active October 14, 2025 18:07
Visidata .visidatarc file

Visidata Config File

In Windows, the config file goes in the user home folder

  • Create the C:\Users\USERNAM\.visidatarc file
    • note the dot in front of the file name
  • add the following to the file
# for VisiData
import datetime

options.color_key_col = "green"
@paul-d-ray
paul-d-ray / Nushell_FD_LS.md
Last active November 9, 2025 21:13
Nushell Combine FD and LS

Purpose

Use FD to find a file and pipe it to Nushell's ls command to list information on the file.

Nushell Code

fd -H -I -i  -E 'Windows' -E 'Python' -E 'Steel*' -E '*ffice*' -E '*ire*' -E '*VS Code*' -E 'WindowsPowerShell' --glob  '*posh*.exe' 'c:\'  | lines | each {|file|  nuls -f  ($file |path dirname) | where name =~ ($file | path basename )  } | flatten

Nushell Code Explained

fd -H -I -i -E 'Windows' -E 'Python' -E 'Steel*' -E '*ffice*' -E '*ire*' -E '*VS Code*' -E 'WindowsPowerShell' --glob '*posh*.exe' 'c:\'

@paul-d-ray
paul-d-ray / Nushell_CLI_Weather_Forecast.md
Last active September 28, 2025 03:04
Nushell CLI Weather Forecast

Using Nushell to get Local Weather

I saw on Hacker News for another programming lanuage. I wanted to get the forecast for my area using Nushell.

  • I used Grok to get the code for my location.

Nushell Code

http get https://api.weather.gov/gridpoints/FFC/32,107/forecast | from json |
  get properties.periods |
@paul-d-ray
paul-d-ray / Nusell_Words_Suffix_List.md
Last active September 23, 2025 00:36
Nushell Get Words with Suffix from a list

Purpose

I had a need to get words (four characters) that have a suffix from a list.

This was to help someone in the second grade with the words.

I used the unixdict.txt to get the words.

Nushell Code

@paul-d-ray
paul-d-ray / Nushell_First_Monday_of_Year.md
Last active September 20, 2025 03:07
Nushell Get First Monday of Each Month of a Year

First Monday of Each Month

I had a need to get the first Monday of each month of 2025.

  • This can be changed to get any other first day by changing the wday variable.
    • su, mo, tu, we, th, fr, sa

Nushell Code

let wday = 'mo'
let year = 2025