In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
Select Basic. Select Long-Running Daemon
Give the script a decent name (I chose auto_dark_mode.py)
Save and open the script in your editor of choice.
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>dev.forwarding.apache</string> | |
| <key>Program</key> | |
| <string>/sbin/pfctl</string> | |
| <key>ProgramArguments</key> | |
| <array> |
| <?php | |
| /** | |
| * Dirty, dirty Reddit bot: Decronym | |
| */ | |
| class Reddit { | |
| const USERNAME = '***'; | |
| const PASSWORD = '***'; | |
| const CLIENTID = '***'; | |
| const SECRET = '***'; |
| class Player | |
| def initialize | |
| @last_health = 20 | |
| end | |
| def play_turn(warrior) | |
| possible_actions = actions.select { |action| action.can? @last_health } | |
| possible_actions.first.go! |