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
# | |
# This file supports http://davesteele.github.io/development/2021/08/29/python-asyncio-curses/ | |
# | |
import asyncio | |
from abc import ABC, abstractmethod | |
from curses import ERR, KEY_RESIZE, curs_set, wrapper | |
import _curses |
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 bash | |
/home/pi/pizero-usb-hid-keyboard/rpi-hid.sh | |
chmod 777 /dev/hidg0 | |
/home/pi/tickle.py & | |
exit 0 |
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
#!/home/pi/virtualenvs/todo/bin/python | |
import dropbox | |
access_token = "" | |
dbx = dropbox.Dropbox(access_token) | |
dbx.files_download_to_file("/home/pi/Dropbox/todo/todo.txt", "/todo/todo.txt") |
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/python3 | |
from collections import namedtuple | |
from datetime import datetime | |
import re | |
import requests | |
import subprocess | |
import sys | |
""" |
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/python3 | |
""" | |
Report the pejacevic piuparts waiting count, by day, in csv format. | |
Counts are broken out by section precedence. | |
""" | |
from collections import defaultdict | |
import csv |
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/python | |
import io | |
import traceback | |
try: | |
1.0/0.0 | |
except ZeroDivisionError as e: | |
with io.StringIO() as fp: | |
traceback.print_exc(file=fp) |
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
<!DOCTYPE busconfig PUBLIC | |
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | |
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | |
<!-- store in /etc/dbus-1/system.d --> | |
<busconfig> | |
<policy user="root"> | |
<allow own="com.foo"/> | |
</policy> | |
<policy context="default"> | |
<allow send_destination="com.foo"/> |
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 hexchat | |
""" | |
Restore and raise the hexchat main window whenever a message is received. | |
To get this working on a recent Ubuntu GNOME environment, you also need to: | |
- Install the Firefox GNOME Shell Integration extension. | |
https://addons.mozilla.org/en-US/firefox/addon/gnome-shell-integration/ | |
- Install the GNOME "Steal My Focus" extension. | |
https://extensions.gnome.org/extension/234/steal-my-focus/ |
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
from collections import OrderedDict | |
# >>> import cache_dict | |
# >>> c = cache_dict.CacheDict(cache_len=2) | |
# >>> c[1] = 1 | |
# >>> c[2] = 2 | |
# >>> c[3] = 3 | |
# >>> c | |
# CacheDict([(2, 2), (3, 3)]) | |
# >>> c[2] |
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/python3 | |
import aiohttp | |
from asyncio import create_task, sleep, wait, Semaphore,\ | |
Queue, run, ALL_COMPLETED | |
from collections import defaultdict | |
import json | |
import re | |
#import random |
NewerOlder