Skip to content

Instantly share code, notes, and snippets.

View jmb's full-sized avatar
🙃
Procrastinating

Jonathan Batchelor jmb

🙃
Procrastinating
View GitHub Profile
@jmb
jmb / README.md
Last active December 8, 2022 08:41
Google Calendar API v3 widget for Dashing

Description

Dashing widget to display the next and some subsequent Google Calendar events using the Google Calendar API v3.

I use this widget to display my shift calendar - see the screenshot below

Set up

This widget works with API v3 and requires a service account to be set up via the Google Developer's Console. Once a project is set up, enable the Calendar API. On the Credentials page create a new OpenID and download the p12 key file - set up the path to this file in the job file and grant the email address access to the relevant calendar.

@jmb
jmb / README.md
Last active January 27, 2019 22:25
MQTT Data Subscriber for Dashing

Description

Dashing job to subscribe to MQTT messages.

MQTT is a lightweight publish/subscribe messaging transport. This job allows Dashing to subscribe to these messages and send them as events. There is no associated widget as the data can take any form - commonly numbers, but not necessarily. The script as laid out below sends events with value, current (the same contents) and last values so can be plugged directly into the Numbers or Meter widgets using the data-id in the dashboard file. The send_event could easily be modified if required.

Set up

Add to Gemfile:

@jmb
jmb / rainbow_all.py
Created September 25, 2016 09:06
A quick and simple demo of the APA102_Pi library which fades the entire LED strip from green through to red then blue and back to green.
#!/usr/bin/python3
import apa102
import signal
from time import sleep
numLEDs = 60
globalBrightness = 5
stepDelay = 0.1
@jmb
jmb / email_addresses.py
Created July 14, 2018 21:58
Script to extract all email addresses from all emails in all folders of an IMAP account.
"""Create a connection to an IMAP server and find ALL email addresses
Original script by abought: https://gist.github.com/abought/15a1e08705b121c1b7bd
References:
http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
and
https://yuji.wordpress.com/2011/06/22/python-imaplib-imap-example-with-gmail/
"""
__author__ = 'jmb'
import email