Skip to content

Instantly share code, notes, and snippets.

@paul-d-ray
paul-d-ray / Nushell_Cleanup_Temp_Folder.md
Last active February 12, 2026 11:21
Nushell Cleanup Temp Folder

Cleanup temp files in the Temp folder

I have been using a cmd file to do this but wrote this using Nushell.

Nushell Code

#!/usr/bin/env nu

# PR 20250503_1747

# PR 20250913_0020
@paul-d-ray
paul-d-ray / Nushell_Verse_of_the_Day.md
Created February 12, 2026 04:57
Nushell VOTD (Verse of the Day)

Show the Verse of the Day

Show the votd for three Bible translations. This uses the BibleGateway api which returns a json file.

Nushell code

#!/usr/bin/env nu
# PR 2026-01-31 02:41:13
# help from Gemini
# Get the Verse of the Day from BibleGateway
@paul-d-ray
paul-d-ray / Nushell_RG_Table.md
Last active February 8, 2026 03:59
Nushell showing RG output as a table

Using RG to find and have Nushell show the results as a table

Nuushell code

rg 'get -o' -g '*.nu' --max-depth 1 --json
| from ndjson
| where type == "match"
| each {|row|
    {
        file: $row.data.path.text
@paul-d-ray
paul-d-ray / Wezterm_Windows_Issues.md
Last active February 8, 2026 01:15
Wezterm running on Windows using Nushell Issues

Here are a few issues I have with Wezterm

I am running Wezterm on Windows.

  • Nusheell has a few issues with Wezterm. I have to disable the OSC133.

    $env.config.shell_integration.osc133 = false

  • Using Nushell in Wezterm, the clear command (and also Ctrl-L), chop off part of the scrollback.

@paul-d-ray
paul-d-ray / settings.json
Created February 6, 2026 22:55
Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@paul-d-ray
paul-d-ray / wezterm.lua
Last active February 7, 2026 03:57
Wezterm Config File
-- Pull in the wezterm API
-- PR 2026-02-06 17:52:03
-- Running on windows
-- Using Nushell set OSC133 = false
-- $env.config.shell_integration.osc133 = false
local wezterm = require 'wezterm'
@paul-d-ray
paul-d-ray / Nushell_Pivot_Trnaspose_by_Year.md
Last active February 8, 2026 18:59
Nushell create a Pivot (Transpose) table

Pivot table of Auto Expenses

Show in a Pivot table how much has been spend by Auto and Year The data has to be cleaned and have fields added

  • Remove commas from the Amount column
  • Add Year and Yearmon columns
  • Spilt the Category column into Auto and Work Columns

This data comes from MS Money, using UE to remove "total" lines, and blank lines.

Nushell Code without Total Row

@paul-d-ray
paul-d-ray / Nushell_Group-by_and_Histogram.md
Last active February 3, 2026 22:57
Nushell using Group-By and Histogram together

I saw this in the Nushell Discotrd Channel. They were showing how they used a group-by and histogram together.

Data

Split Records

The reaction_watch.csv "Subject" field can have more than one "field of study".

@paul-d-ray
paul-d-ray / Nushell_Loop_Folder_from_Variable.md
Created January 23, 2026 22:06
Nushell Loop thru folders in a variable

$nu variable

From the Help file about $NU

This is from Nushell 0.110.0 $nu The $nu constant is a record containing several useful values:

  • default-config-dir: The directory where the configuration files are stored and read.
  • config-path: The path of the main Nushell config file, normally config.nu in the config directory.
  • env-path: The optional environment config file, normally env.nu in the config directory.
  • history-path: The text or SQLite file storing the command history.
  • loginshell-path: The optional config file which runs for login shells, normally login.nu in the config directory.
@paul-d-ray
paul-d-ray / Polars_Xan_Sum_Filter.md
Last active January 12, 2026 18:57
Using Nushell and Polars vs Xan to filter, sum

Determine how much was spent on Groceries

I exported the data from MS Money, for all years (2010 + 2025) the details on Grocies.

I wanted to see how to sum the data by year for one grocey store.

I had done this in Visidata, and I knew both Nushell with the Polars plugin and Xan could do it, so I decided how to get the syntax correct in both.

This is a very small dataset, only 1054 records.