List of notes tagged tricks

Undo last commit in git

Undoing the last commit keeps changes staged, allowing you to modify or re-commit without losing any work, perfect for tweaking messages or adding updates..

Get script directory or file name

Get the filename and directory path of a Python script in the file system using the __file__ variable and the os module.

Convert iterator of Result into Result of iterator

Learn how to turn an iterator with potential errors into one that either processes all valid values or stops at the first encountered error.

©2023‐2024hack nota