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
#!/bin/env sh | |
clear && python main.py && git commit -a -m 'tcr' || git reset --hard | |
# combine with: | |
# ls main.py | entr ./tcr.sh |
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
class Spy: | |
# replace getattr of class and collect all calls | |
# and the return the underlying class' getattr | |
def __init__(self, cls): | |
self.spy_on = cls.__name__ | |
self.cls_getattr = cls.__getattribute__ | |
self.cls_getitem = cls.__getitem__ | |
self.attributes_read = set() |
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
<?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"> | |
<!-- Generated by: TmTheme-Editor --> | |
<!-- ============================================ --> | |
<!-- app: http://tmtheme-editor.herokuapp.com --> | |
<!-- code: https://github.com/aziz/tmTheme-Editor --> | |
<plist version="1.0"> | |
<dict> | |
<key>author</key> | |
<string>Olof Bjarnason</string> |
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 python3 | |
# | |
# Python script to wish Merry Christmas using turtle. | |
# Author - Anurag Rana | |
# | |
from random import randint | |
### | |
# Added for approval testing purposes |
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
import pickle | |
def remember(filepath, change): | |
"""Update and persist simple data to filepath using pickle module. | |
The change callback updates the data read from disk; | |
if the file does not exist None is passed and you are | |
responsible for building the initial data. | |
Example use, to keep track of how many times a script has been run: |
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
import qp | |
async def backup_procedure(): | |
async def zip_folder(folder, archive_file): | |
# ??? | |
backup_fn = # ... | |
backup_folder = # ... | |
await zip_folder(backup_folder, backup_fn) | |
qp.publish(qif.BACKUP_DONE) |
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
# License - MIT / do whatever | |
## rev3 - add result gathering | |
async def child(name, journal): | |
print(f"{name}: My name is: " + name) | |
staytime = random.randint(1, 3) | |
print(f"{name}: I will stay for {staytime} seconds.") | |
print(f"{name}: I will jot down my name in the journal") | |
journal.append(name) |
NewerOlder