Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@SpotlightKid
SpotlightKid / MarkdownPDF.py
Last active August 25, 2023 20:55
Markdown to PDF Conversion for Pythonista
# Markdown to PDF Conversion
#
# This script converts Markdown markup to PDF directly on your iOS device.
#
# Please see the "Requirements" section in the docstring below for required
# dependencies and the "Installation" section for instructions on how to
# install them.
#
# Run this script directly or put it into the Pythonista editor action menu
# with one of the following options as the first and sole argument:
@SpotlightKid
SpotlightKid / github_download.py
Created August 6, 2014 14:12
Github file viewer / general URL download script for Pythonista
"""Prompt user for URL and filename and download the remote resource to a file.
If the clipboard contains a HTTP(S) or FTP(S) URL, the URL input dialog is
pre-filled with it.
The suggested local filename is extracted from the URL, if possible.
If a github file viewer URL is given, it is transformed into the matching
raw file access URL, which makes it easier to download files on github you
are viewing in your browser. Just copy the URL to the clipboard, change to
@SpotlightKid
SpotlightKid / wagenheber.py
Last active March 19, 2023 03:07
Simple PyPI package installation client for Pythonista
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#
# wagenheber.py
#
"""Simple PyPI package installation client for Pythonista.
Currently only supports installing pure Python packages for which a
distribution archive in bdist_wheel format is available on PyPI.
@SpotlightKid
SpotlightKid / 4op_fm.py
Last active January 23, 2017 11:00
A four-operator FM script generating a 64 wave 128 samples per cycle wavetable
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""A four-operator FM script generating a 64 wave 128 samples per cycle wavetable.
Requires the numpy and matplotlib third-party modules.
Ported from:
http://www.waldorf-music.info/kunena-en/blofeld-en/280-wavetable-script-for-blofeld-4-operator-fm
@SpotlightKid
SpotlightKid / email_ankuendigung.py
Last active August 29, 2015 14:05
Format announcement of next user group meeting given a template and a data file and open an email client with recipient, subject and body pre-filled.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Format announcement of next user group meeting given a template and a data
file and open an email client with recipient, subject and body pre-filled.
Usage:
ankuendigung.py ankuedigung.tmpl meeting.data
where ``ankuendigung.tmpl`` is a Jinja2 template and ``meeting.data`` is an
@SpotlightKid
SpotlightKid / AutomationTest.py
Last active December 1, 2023 16:05
Test integration of Pythonista UI and MQTT.
# coding: utf-8
from __future__ import print_function
import socket
import struct
import ui
import paho.mqtt.client as mqtt
@SpotlightKid
SpotlightKid / AutomationTest.pyui
Created August 14, 2014 00:22
Pythonista UI file for AutomationTest.py
[{"class":"View","attributes":{"name":"Automation Test","background_color":"RGBA(1.000000,1.000000,1.000000,1.000000)","tint_color":"RGBA(0.000000,0.478000,1.000000,1.000000)","enabled":true,"border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","flex":""},"frame":"{{0, 0}, {540, 575}}","nodes":[{"class":"View","attributes":{"enabled":true,"flex":"W","name":"view1","corner_radius":5,"border_width":1,"border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","background_color":"RGBA(0.928571,0.937143,1.000000,1.000000)","uuid":"320B1558-A4C5-4FD7-8DCE-208BAA15B0DC"},"frame":"{{9, 18}, {515, 107}}","nodes":[]},{"class":"Switch","attributes":{"enabled":true,"flex":"","name":"sw_light","value":false,"action":"","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","uuid":"AEB0BAA8-F834-46B4-9825-E4D652511996"},"frame":"{{152, 58}, {51, 31}}","nodes":[]},{"class":"Label","attributes":{"font_size":17,"enabled":true,"text":"Licht an\/aus","flex":"","name":"label1","border_color":"RGBA(0.000000,0.000000,0.00
@SpotlightKid
SpotlightKid / pystone.py
Last active May 24, 2021 19:20
pystone benchmark compatible with Python 2 and 3
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
@SpotlightKid
SpotlightKid / parsedate.py
Last active August 29, 2015 14:05
Parse ISO-8601 formatted date/time strings with UTC offsets.
# -*- coding:utf-8 -*-
"""Parse ISO-8601 formatted date/time strings.
Uses only standard library modules and supports UTC offsets.
"""
__all__ = ("parse_isodate", "UTCOffset")
import re
@SpotlightKid
SpotlightKid / convert_hexstring.py
Created August 25, 2014 08:30
Convert a string in ASCII hexadecimal notation into a list of integers.
# -*- coding:utf-8 -*-
"""Convert a string in ASCII hexadecimal notation into a list of integers.
Example::
>>> convert_hexstring('F0 7E 7F 06 01 F7')
[240, 126, 127, 6, 1, 247]
>>> convert_hexstring('f07E7F 6 1 F7')
[240, 126, 127, 6, 1, 247]