This file contains hidden or 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 subprocess | |
| def extract_commit(log): | |
| return log[7:7+40] | |
| def extract_date(log): | |
| return log.splitlines()[4].split("CommitDate:")[1].strip() | |
| outp = subprocess.check_output("git log -1 --pretty=fuller", shell=True).decode() | |
| commit = extract_commit(outp) |
This file contains hidden or 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 csv | |
| import sys | |
| def main(): | |
| if len(sys.argv) < 1+1 or len(sys.argv) > 1+2: | |
| print(f"usage: {sys.argv[0]} INPUT_CSV [OUTPUT_FILE]") | |
| return | |
| fi = open(sys.argv[1], newline='') | |
| fo = sys.stdout |
This file contains hidden or 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 collections | |
| import os | |
| import hashlib | |
| import filecmp | |
| def main(): | |
| sizes = collections.defaultdict(list) | |
| for dirent in os.scandir(): | |
| if not dirent.is_file(follow_symlinks=False): |
This file contains hidden or 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 errno | |
| import os | |
| import sys | |
| def main(): | |
| exitcode = 0 | |
| errorcode_inverse = {v: k for k, v in errno.errorcode.items()} | |
| for arg in sys.argv[1:]: | |
| try: |
This file contains hidden or 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
| static lv_obj_t * scale; | |
| static lv_obj_t * minute_hand; | |
| static lv_obj_t * hour_hand; | |
| static lv_point_precise_t minute_hand_points[2]; | |
| static lv_point_precise_t hour_hand_points[2]; | |
| static int32_t hour; | |
| static int32_t minute; | |
| static void timer_cb(lv_timer_t * timer) | |
| { |