1. PHPUnit’s HTML code coverage reports don’t play nicely with GitHub pages “main branch /docs folder” by default, as they store CSS, JS and icon assets in folders prefixed with underscores.

    Here’s a little bash script to run tests with code coverage enabled, then move the assets around:

    rm -rf docs/coverage/
    XDEBUG_MODE=coverage  ./vendor/bin/phpunit tests --coverage-filter src --coverage-html docs/coverage
    mv docs/coverage/_css docs/coverage/phpunit_css
    mv docs/coverage/_icons docs/coverage/phpunit_icons
    mv docs/coverage/_js docs/coverage/phpunit_js
    grep -rl _css docs/coverage | xargs sed -i "" -e 's/_css/phpunit_css/g'
    grep -rl _icons docs/coverage | xargs sed -i "" -e 's/_icons/phpunit_icons/g'
    grep -rl _js docs/coverage | xargs sed -i "" -e 's/_js/phpunit_js/g'
    

    That allows you to use GitHub pages to show code coverage reports as well as docs, as I’m doing for taproot/indieauth.

  2. Broken your mac by removing the execute permissions on /bin/bash, or otherwise need to get shell access to fix something? (Say, for example, you were foolishly trying to patch shellshock). Don’t worry! It’s concerningly easy.

    1. Reboot your mac holding down Cmd+R
    2. Go Utilites → Terminal
    3. You’re currently in a recovery partition. cd /Volumes/Macintosh HD/bin
    4. Do whatever you need to do to fix your machine, e.g. chmod a+x bash
    5. Restart, and everything should be fine.