Skip to content

Instantly share code, notes, and snippets.

View KurtJacobson's full-sized avatar

Kurt Jacobson KurtJacobson

View GitHub Profile
@KurtJacobson
KurtJacobson / index.html
Created January 22, 2018 20:36
WebSocket server extension for WeeWx for real time weather data without having to refresh web page.
<!DOCTYPE html>
<html>
<head>
<title>WebSocket</title>
</head>
<body>
<h2>WeeWx WebSocket Example</h2>
<p>Example of real time weather data display using WebSockets. The data is
updated on each LOOP packet.
</p>
@KurtJacobson
KurtJacobson / building_pyqt5.md
Last active October 19, 2023 00:33
Building PyQt5 to support Python2 based QtDesigner Plugins

Building PyQt5 to support Python2 based QtDesigner Plugins

As far as I can tell, the reason Qt5 Designer does not load custom PyQt5 widgets is due to the 'stock' shared library libpyqt5.so (which comes with PyQt5) not being built for the correct combination of the Python and Qt versions. It seems the only way to get around this is to build PyQt5 from source so we will have a libpyqt5.so that is correct and will be able to load the custom widgets.

Install Python dev tools

@KurtJacobson
KurtJacobson / QtVCP_Plugins.md
Last active August 17, 2022 06:09
Installing Qt VCP Qt Designer Plugins

Installing Qt VCP Qt Designer Plugins

Fist, you need to be using Python 2.7 and PyQt4

To install PyQt4 I ran

$ sudo apt-get install python-qt4-dev

Open a root file browser and navigate to (replace x86_64 with your machine's architecture)

@KurtJacobson
KurtJacobson / transparent_window.py
Last active July 28, 2021 08:25
Transparent Window in Gtk+ 3, python
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import cairo
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@KurtJacobson
KurtJacobson / module_watcher.py
Created October 17, 2017 22:46 — forked from eberle1080/module_watcher.py
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <eberle1080@gmail.com>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""

Keybase proof

I hereby claim:

  • I am kurtjacobson on github.
  • I am kcj (https://keybase.io/kcj) on keybase.
  • I have a public key ASAPsvmYx17Ca74L-ooYbmOQrs14xHl7f9losSG6-kpNPgo

To claim this, I am signing this object:

@KurtJacobson
KurtJacobson / touchscreen_calibration.md
Last active February 27, 2024 22:06
Touchscreen calibration procedue for Debian9 (stretch)

Touchscreen Calibration in Debian9

Unfortunately [xinput-calibrator][1] does not work at all for calibrating a touchscreen in Debian9. This is apparently because X server now uses libinput to handle input devices instead of evdev. I spent huge amount of trying to fiddling with xinput-calibrator and 99-calibration.conf files until I finely found this [issue][2] on GitHub that gave me some hints as how to proceed. This is mostly for my own reference, but I hope it might also help others in the same situation.

#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>
#include <LedControl.h>
Encoder knob(0, 1);
LedControl lc = LedControl(12, 11, 10, 3);
int steps = 0;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hal
import sys
import signal
import linuxcnc
import copy
import time
@KurtJacobson
KurtJacobson / app.py
Created September 30, 2017 15:25
SO Colored Logging Formatter Example files
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import logging
from colored_log import ColoredFormatter
# Create top level logger
log = logging.getLogger("main")