On MacOS:
Get dfu-programmer from homebrew.
Get hex file from github. (Click on raw version, then wget the hyperlink. Be sure to remember file path where it is saved.)
Pull ducky out of machine. Hold down button while putting back into machine. No lights should be on, and it will not show up in finder.
Then run these commands in terminal in sequence:
sudo /usr/local/bin/dfu-programmer at32uc3b1256 dump >dump.bin
sudo /usr/local/bin/dfu-programmer at32uc3b1256 reset
sudo /usr/local/bin/dfu-programmer at32uc3b1256 erase
sudo /usr/local/bin/dfu-programmer at32uc3b1256 flash --suppress-bootloader-mem <.hex file path>
sudo /usr/local/bin/dfu-programmer at32uc3b1256 reset