Skip to content

Instantly share code, notes, and snippets.

Jonathan Batchelor jmb

  • Hampshire, UK
View GitHub Profile
@jmb
jmb / email_addresses.py
Created Jul 14, 2018
Script to extract all email addresses from all emails in all folders of an IMAP account.
View email_addresses.py
"""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
@jmb
jmb / rainbow_all.py
Created Sep 25, 2016
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.
View rainbow_all.py
#!/usr/bin/python3
import apa102
import signal
from time import sleep
numLEDs = 60
globalBrightness = 5
stepDelay = 0.1
@jmb
jmb / README.md
Last active Jan 27, 2019
MQTT Data Subscriber for Dashing
View README.md

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 / README.md
Last active Feb 14, 2019
Google Calendar API v3 widget for Dashing
View README.md

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.

You can’t perform that action at this time.