Skip to content

Instantly share code, notes, and snippets.

View KurtJacobson's full-sized avatar

Kurt Jacobson KurtJacobson

View GitHub Profile
#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
@gene1wood
gene1wood / analyze_pypi_package_names.py
Last active May 3, 2024 19:34
Analysis of PyPi package names and the use of dashes underscores upper and lower case
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
packages = client.list_packages()
total = len(packages)
dashes = len([x for x in packages if '-' in x])
@espdev
espdev / qtabwidget.css
Last active May 1, 2024 06:52
A QTabWidget Custom Stylesheet Example
QTabWidget::pane {
border: 1px solid black;
background: white;
}
QTabWidget::tab-bar:top {
top: 1px;
}
QTabWidget::tab-bar:bottom {
@rochacbruno
rochacbruno / mainpython.md
Last active July 5, 2023 10:56
Use of __main__.py

The use of __main__.py to create executables

myprojectfolder/
    |_ __main__.py
    |_ __init__.py

Being __main__.py:

print("Hello")

@sergejx
sergejx / gist:2358089
Created April 11, 2012 08:59
Set dark theme for GTK+ application
from gi.repository import Gtk
settings = Gtk.Settings.get_default()
settings.set_property("gtk-application-prefer-dark-theme", True)
@eberle1080
eberle1080 / module_watcher.py
Created June 7, 2011 20:50
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):
"""
@nzjrs
nzjrs / FooThread.py
Created January 25, 2009 04:43
PyGtk threading example
# Demo application showing how once can combine the python
# threading module with GObject signals to make a simple thread
# manager class which can be used to stop horrible blocking GUIs.
#
# (c) 2008, John Stowers <john.stowers@gmail.com>
#
# This program serves as an example, and can be freely used, copied, derived
# and redistributed by anyone. No warranty is implied or given.
import gtk
import gobject