Add padding under each Jupyter cell

Put one of the following in a Jupyter notebook cell and run. If you make changes, clear cell contents, save, and refresh the browser.


All cells:

import IPython.core.display as di

di.display_html("""
$('<style>.cell { margin-bottom: 100px !important;}</style>').appendTo('head');
""", raw=True)

To add padding just after code cells:

import IPython.core.display as di

di.display_html("""
$('<style>.code_cell { margin-bottom: 100px !important;}</style>').appendTo('head');
""", raw=True)

To add padding just between code cells:

import IPython.core.display as di

di.display_html("""
$('<style>.code_cell+.code_cell { margin-top: 100px !important;}</style>').appendTo('head');
""", raw=True)

macOS: Set audio balance to middle to correct drift with an AppleScript

On multiple Macs, I have had the left/right balance of my headphones randomly drift. Apple says this can be caused by changing the volume while the CPU is under load, which doesn't seem to be what is happening to me. In any case, it's annoying.

Here's an AppleScript that will automatically reset the sound balance to the middle for the current output device:

There's also a $5 app called Balance Lock that in theory will solve this problem – I haven't tested it.