Skip to content

Instantly share code, notes, and snippets.

@AlanBell
AlanBell / agendafree.html
Last active November 9, 2023 20:16
Agenda Free with an overlay
<html>
<div id="video" style="position:absolute;">
<iframe width="1920" height="1080" src="https://www.youtube.com/embed/ZV-ftihBDp8?si=jONZWtEdPJSd7XpW"
title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
<div id="overlay">
<img src="gaza.png" style="position:absolute;pointer-events:none;opacity:16%;">
</div>
</html>
@AlanBell
AlanBell / ennis.json
Created January 16, 2022 23:04
station info for Ennis
{'monitor_id': 1973, 'label': 'Station 25', 'location': 'Ennis, Co. Clare', 'latitude': '52.843206', 'longitude': '-8.989332', 'code': 'EPA-25', 'serial_number': 'EPA-25', 'last_calibrated': '0000-00-00', 'monitor_type_id': 25, 'latest_reading_id': 307732100, 'monitor_type': {'monitor_type_id': 25, 'name': 'Multiple', 'manufacturer': 'Multiple', 'category': 'air', 'sample_code': '', 'sample_serial_number': ''}, 'latest_reading': {'air_reading_id': 307732100, 'monitor_id': 1973, 'project_id': 2399, 'recorded_at': '2022-01-16 21:30:00', 'pm10': 182.052, 'pm2_5': 174.986, 'no2': None, 'o3': None, 'so2': 67.85, 'co': None, 'date': '16-01-2022', 'time': '21:30', 'secs_since': 5278, 'time_since': '1 hour', 'status': 'green'}, 'latest_averages': {'pm10': {'start': '2022-01-15 21:01:00', 'end': '2022-01-16 21:00:00', 'value': 111.26, 'num_readings': 96, 'percentage_capture': 100, 'rating': 10}, 'pm2_5': {'start': '2022-01-15 21:01:00', 'end': '2022-01-16 21:00:00', 'value': 105.03, 'num_readings': 96, 'percentage_cap
@AlanBell
AlanBell / stepper.py
Last active November 30, 2021 20:50
A hello world for the 28BYJ-48 Stepper motor
#!/usr/bin/python3
import time
import machine
#the stepper motor can be driven by energising the 4 coils in different sequences
#considering them as binary values converted to decimal (so coil activation 0110 would be 6)
#we can express the sequences like this
wave=[1,2,4,8]#wave low torque, low power consumption?
fullstep=[3,6,12,9]#full step (more torque?)
halfstep=[1,3,2,6,4,12,8,9]#half steps, longer sequence but can be stepped through faster
@AlanBell
AlanBell / blockqr.py
Last active December 8, 2020 21:09
silly thing to render QR codes with unicode block characters
!#/usr/bin/python3
import pyqrcode
#first create a code, and convert it to text as a pattern of 0 and 1
code = pyqrcode.create("westbrit.ie")
text=code.text()
def blockify(block):
#this converts a representation of a 2x2 block into a unicode character
bricks={
"0000":" ",