Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port before_v0.60/math, before_v0.60/parsing and before_v0.60/git #844

Merged
merged 6 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions before_v0.60/git/git_branch_cleanup.nu

This file was deleted.

33 changes: 0 additions & 33 deletions before_v0.60/maths/math_functions.nu

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Creates a table listing the branches of a git repository and the day of the last commit
def "git age" [] {
export def "git age" [] {
git branch |
lines |
str substring 2, |
str substring 2.. |
wrap name |
insert last_commit {
get name |
each {
git show $it --no-patch --format=%as | str to-datetime
git show $in --no-patch --format=%as | into datetime
}
} |
sort-by last_commit
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ def look_for [word] {
insert comp {
get shoes_name |
split row " " |
each --numbered {
[[idx, loc]; [$it.index, ($it.item | str index-of $word)]]
}
enumerate | each {
[[idx, loc]; [$in.index, ($in.item | str index-of $word)]]
} | flatten
} |
flatten |
where comp.loc >= 0 |
flatten |
update idx { $it.idx + 1 } |
update idx { $in + 1 } |
reject name price loc |
rename nameWords targetWordIndex
}

look_for "leather" | to json --pretty 4
look_for "low-top" | to json --pretty 4
print (look_for "leather" | to json --indent 4)
print (look_for "low-top" | to json --indent 4)
Loading