This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# capture wordcounts in dayfile | |
# invoke with project root as argument; default is (currently) start-apl | |
# assumes book contents are markdown files in the `manuscript` directory | |
# creates a `progress` direectory if necessary | |
# writes wordcounts (using wc) for each markdown file and totals in a file whose name is based on today's date | |
_project=${1:-start-apl} | |
cd ~/git/active/$_project/ | |
_now=$(date +"%Y%m%d") | |
mkdir -p progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ***WARNING*** | |
# Running this file will delete all files and directories from the micropython device it's running on | |
# If you run keep_this=False it will delete this file as well. | |
# see https://docs.micropython.org/en/latest/library/os.html for os function list | |
import os | |
def _delete_all(directory='.', keep_this=True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Convert a note pitch like A#4 to its frequency. | |
""" | |
# Generate a unique pitch for a note based on its pitch class and octave. | |
def name(pitch_class: str, octave: int) -> str: | |
return f"{pitch_class}{octave}" |
OlderNewer