Skip to content

Instantly share code, notes, and snippets.

View WayneKeenan's full-sized avatar

Wayne Keenan WayneKeenan

  • Cambridge, UK
  • 06:10 (UTC +01:00)
View GitHub Profile
@WayneKeenan
WayneKeenan / summaries_db.json
Created February 21, 2025 06:52
CAT page AI summaries
[
{
"pageId": 1786,
"pageUrl": "https://wiki.rossmanngroup.com/wiki/index.php?curid=1786",
"summaryDetails": {
"originalSummary": "Below is a list of companies that have dedicated articles in the CAT wiki.",
"originalSummaryLength": 74,
"aiSummary": "List of companies with dedicated articles in the CAT wiki.",
"aiSummaryLength": 58,
"error": ""
IDENTIFICATION DIVISION.
PROGRAM-ID. TARGET-GUIDANCE.
AUTHOR. YOUR NAME.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
@WayneKeenan
WayneKeenan / build.sh
Last active August 16, 2023 08:24
Build Pico W examples
# You will need: cmake, make and an arm-none-eabi-gcc compiler on your PATH already.
export PROJECT_DIR=$PWD # or anywhere else.
export PICO_SDK_PATH=${PROJECT_DIR}/pico-sdk
export PICO_EXAMPLES_PATH=${PROJECT_DIR}/pico-examples
export PICO_EXTRAS_PATH=${PROJECT_DIR}/pico-extras
git clone https://github.com/raspberrypi/pico-sdk.git
git clone https://github.com/raspberrypi/pico-extras.git
from gpiozero import LED
from bubblepy import peripheral, gatt
@gatt.service(0x1234)
class Light:
def __init__(self):
self.led = LED(17)
@gatt.characteristic(0xABCD, ['write'], "Set Light State")
@WayneKeenan
WayneKeenan / microbit_gpiozero_buttons.py
Created September 19, 2018 11:48
gpiozero buttons on the microbit
from gpiozero import Button
def buttonA_pressed():
print("Button A")
def buttonB_pressed():
print("Button B")
buttonA = Button(13)
buttonA.when_pressed(buttonA_pressed)
# python3 -m venv my-venv
# source my-venv/bin/activate
# pip3 install --upgrade pip setuptools wheel
# hg clone https://bitbucket.org/ronaldoussoren/pyobjc pyobjc # e.g. homebrew install mercurial
# cd pyobj
# python3 install.py # You will need XCode installed in order to compile the native extensions.
# python3 ../test_4.1.py
# deactivate
import objc
# python3 -m venv my-venv
# source my-venv/bin/activate
# pip3 install --upgrade pip setuptools wheel
# python3 dispatch_test.py
# deactivate
import ctypes
import objc
from PyObjCTools import AppHelper
import CoreBluetooth
@WayneKeenan
WayneKeenan / test_macos_pyobjc_dispatch_observer.py
Last active November 14, 2017 08:04
test_macos_pyobjc_dispatch_observer.py
import threading
from logging import getLogger, basicConfig, DEBUG
from time import sleep
import objc
from Foundation import *
from PyObjCTools import AppHelper
import CoreBluetooth
from ctypes import cdll, Structure, POINTER, pointer, c_int, c_char_p, c_void_p, cast
# http://python.net/crew/theller/ctypes/tutorial.html
@WayneKeenan
WayneKeenan / main.py
Last active November 2, 2017 05:11
PiCraftZero test script, demoing self install of its 2 dependancies for PiratePython
#!/usr/bin/env python3
import pip
pip.main(['install', 'gpiozero'])
pip.main(['install', 'picraftzero']) # Joypad and Web Remote controls with multiple camera support, please see
# https://github.com/WayneKeenan/picraftzero
from picraftzero import Joystick, Wheelbase, steering_mixer, start
# Joystick axis range is: (left/down) -100 .. 100 (right/up)
@WayneKeenan
WayneKeenan / mac-vagrant-howto.rst
Created October 22, 2017 12:51 — forked from tbonesteaks/mac-vagrant-howto.rst
brew, vagrant, virtualbox, and vagrant file howto...

Vagrant on Mac w Virtualbox

NSoT engineers have built Vagrantfiles for you to deploy NSoT software in a multitude of linux environments. This tutorial will help you load a Macintonsh computer (OS X) with Vagrant, Virtual Box, and dependencies so that you can start virtual servers and test the software.

NSoT publishes complete installation instructions for linux distributions, branch versions, and Vagrantfiles in addition to, not an alternative for the pip install method:

$ pip-install nsot