Skip to content

Instantly share code, notes, and snippets.

@sparkslabs
sparkslabs / odg2svgs.py
Created June 4, 2024 14:43 — forked from johnjohnlin/odg2svgs.py
A simple script converting an odg file into individual SVG pages, works for libreoffice 7.0
#!python
# usage: if you have an xxx.odg, then execute `./odg2svgs.py xxx`
import sys
import subprocess
import xml.etree.ElementTree as ET
kBASENAME = sys.argv[1]
subprocess.run(["libreoffice", "--draw", "--headless", "--convert-to", "svg", kBASENAME+".odg"], check=True)
tree = ET.parse(kBASENAME + ".svg")
@sparkslabs
sparkslabs / utc
Created October 29, 2020 17:05
A simple program to emit the current UTC time, but also renames files with the file's timestamp
#!/usr/bin/python3
import time
import sys
import os
now_timestamp = time.time()
now = time.localtime(now_timestamp)
# time.struct_time(tm_year=2017, tm_mon=1, tm_mday=10, tm_hour=15, tm_min=45, tm_sec=17, tm_wday=1, tm_yday=10, tm_isdst=0
@sparkslabs
sparkslabs / petition_watch.py
Last active March 21, 2019 12:48
Watch a specific petition (assumes you have toilet (figlet) installed
#!/usr/bin/python3
#
# This is a quick and dirty script to watch the petition, and back off when there's failures
# It also tries to resync back to checking once every 5 minutes.
# It also logs the data
# There's some hardcoded stuff. Deal with it.
#
# Accessing the json feed for this data is likely to be less disruptive.
#

Rename this ?

I've got a question for you:

  • If you took a brief look at this API, what name would you expect this IOT Device Stack to have?

Context: This project currently has a terrible name, but it does useful stuff. I suspect that the terrible name is the reason it's not being used.

Any comments on better names welcome via: http://twitter.com/sparks_rd