Skip to content

Instantly share code, notes, and snippets.

@smartwatermelon
Last active January 2, 2025 22:01
Show Gist options
  • Select an option

  • Save smartwatermelon/08c4fdad3ea5b99bb0e9cb7d7a4f0df2 to your computer and use it in GitHub Desktop.

Select an option

Save smartwatermelon/08c4fdad3ea5b99bb0e9cb7d7a4f0df2 to your computer and use it in GitHub Desktop.
@cassidoo's interview question from December 30, 2024, in Bash
$ newYearsDay(){ date -v "${1:-$(date +"%Y")}y" -v 01m -v 01d +"%A"; }
$ newYearsDay 2025
Wednesday
$ newYearsDay 2024
Monday
$ newYearsDay # default value is current year
Wednesday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment