Skip to content

Instantly share code, notes, and snippets.

@sveinse
sveinse / api.py
Created September 18, 2023 00:29
Zaptec api.py with all API calls in `class Account`
"""Main API for Zaptec."""
from __future__ import annotations
import asyncio
import json
import logging
from abc import ABC, abstractmethod
from collections.abc import Iterable
from concurrent.futures import CancelledError
from functools import partial
@sveinse
sveinse / msvc-build-master.diff
Created September 26, 2020 11:11
Portaudio patches for MSVC 2019 build
diff --git a/build/msvc/portaudio.def b/build/msvc/portaudio.def
index c08243a..00698fa 100644
--- a/build/msvc/portaudio.def
+++ b/build/msvc/portaudio.def
@@ -35,14 +35,9 @@ Pa_GetStreamReadAvailable @31
Pa_GetStreamWriteAvailable @32
Pa_GetSampleSize @33
Pa_Sleep @34
-PaAsio_GetAvailableBufferSizes @50
-PaAsio_ShowControlPanel @51
@sveinse
sveinse / gist:7a0523042e39eb1840682cb86800faf1
Last active August 19, 2020 16:35
Portaudio wiki convert log trial2
/c/Svein/Prosjekt/portaudio-convert$ git clone https://github.com/sveinse/portaudio-convert-trial2.wiki.git portaudio-convert-trial2.wiki
Cloning into 'portaudio-convert-trial2.wiki'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 253 bytes | 19.00 KiB/s, done.
/c/Svein/Prosjekt/portaudio-convert$ venv/Scripts/python assembla2github.py -f data/dump.js -u data/users.js -w data/wiki.js -a auth.json wikiconvert portaudio-convert-trial2.wiki
INFO: Reading authentication data from 'auth.json'
INFO: Parsing dumpfile 'data/dump.js'
@sveinse
sveinse / pysndfile_build.sh
Last active April 17, 2022 16:25
Scheme for setting up pysndfile and libraries on Windows
#!/bin/bash -x
# The purpose of this script is to build a pysndfile wheel.
# The main purpose of generating a wheel, is to be able to distribute
# the wheel similar to the binary files, not needing to recompiling the
# module on every install.
disr="dist"
binaries="libsndfile_binaries_win32"
venv="venv-pysndfile"
@sveinse
sveinse / dpkg-scansys.py
Created July 23, 2018 11:16
Tool for comparing dpkg database with file system
#!/usr/bin/python
#
# Tool for listing all non-debian files in a system.
#
import os, sys, stat, re
import optparse
import hashlib
@sveinse
sveinse / _syslog.py
Last active January 4, 2018 18:50
Proposed syslog observer for Twisted
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Syslog log observer.
"""
syslog = __import__('syslog')
from zope.interface import implementer