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
#qpy:webapp:Hello QPython | |
#qpy://127.0.0.1:8080/ | |
""" | |
This is a sample for qpython webapp | |
""" | |
import os | |
import time | |
import androidhelper | |
from bottle import Bottle, ServerAdapter | |
from bottle import run, debug, route, error, static_file, template, request |
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 enum import Enum, auto | |
frame = '''{{ | |
"id": -1, | |
"iid": {iid}, | |
"text": "{text}", | |
"poseId": {poseId}, | |
"pairPoseId": null, | |
"bubbleType": 0, | |
"username": "{name}", |
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 xml.etree.ElementTree as ET | |
import shutil | |
import os | |
CARD_FILE_OUT = 'order_HLB.xml' | |
TYPE = '.png' | |
IMAGE_SOURCE = 'C:/Users/feros/Documents/HLB_Deck/' |
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 json | |
CARD_FILE_IN = 'card_save.json' | |
CARD_FILE_OUT = 'card_save_fixed.json' | |
with open(CARD_FILE_IN, 'rb') as fd: | |
data = json.load(fd) | |
for i, card in enumerate(data): | |
card["data"]["bottomInfo"]["wizards"]["text"] = '' |
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
# Use chrome to capture a har file of the page load and save it as data/cardconjurer.com.har | |
# To run do cd data/local_site; python3 -m http.server | |
import base64 | |
import json | |
import os | |
import pathlib | |
import re | |
import requests |
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 re | |
def get_enum_values(enum_str): | |
re_name_type = re.compile(r'^enum class (.+) : (.+) {') | |
re_name = re.compile(r'^enum .+ (.+) {') | |
re_key_value = re.compile(r'^ +(.+) = (.+),') | |
re_key = re.compile(r'^ +(.+),') | |
name = None |
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 | |
# This script is based on http://www.richwhitehouse.com/index.php?postid=72 | |
# which in turn was based on https://github.com/koalazak/dorita980 which is | |
# an actually decent node implementation | |
# While it can be used as a library function to query Roomba status, | |
# this script can also be used as a local check in check_mk | |
# https://docs.checkmk.com/latest/en/localchecks.html to make a server | |
# have a service monitoring a roomba. Outputs a string like: |
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 re | |
import urllib.parse | |
import requests | |
class PiHoleControl(): | |
headers = {'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'} | |
def __get_token(self): |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Aug 21 11:02:21 2018 | |
@author: axlan | |
""" | |
import requests | |
import sys | |
import re |