Skip to content

Instantly share code, notes, and snippets.

import asyncio
from bleak import BleakScanner, BleakClient
from bleak.backends.characteristic import BleakGATTCharacteristic
ADDRESS = "70:CB:0D:D0:34:1C"
MODEL_NBR_UUID = "2A24"
UART_SERVICE_UUID = "6E40FFF0-B5A3-F393-E0A9-E50E24DCCA9E"
#!/usr/bin/python3
"""
A lil script to put files on https://cdn.tahnok.ca for use in blog posts or sharing or whatever
Accepts either a path or a URL.
If the filename is longer than 40 characters, make a random UUID based on the filename
Depends on wget and scp
"""
"""
Python 3.7+ script to download episodes of radio three sixty
Reads from radiothreesixtyacc.xml, a copy of the iTunes RSS feed. Fetched from archive.org
Episodes are saved in a '$EP_NUMBER - Radio Three Sixty $SHOW_TITLE.m4a' format
Metadata about the files are written to manifest. This includes:
- show title
"""
RFM9x to influxdb bridge
Learn Guide: https://learn.adafruit.com/lora-and-lorawan-for-raspberry-pi
"""
import struct
import board
import busio
"""
RFM9x to influxdb bridge
Learn Guide: https://learn.adafruit.com/lora-and-lorawan-for-raspberry-pi
"""
import struct
import board
import busio
import xml.etree.ElementTree as ET
import requests
raw = requests.get("http://www.threesixtyrecords.net/podcasts/radiothreesixtyacc.xml").content
root = ET.fromstring(raw)
urls = [item.find('enclosure').get('url') for item in root[0].findall('item')]
#include <SD.h>
const int sdChipSelect = 10;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if (!SD.begin(sdChipSelect)) {
while(1) {}
BOOLEAN toggle = TRUE;
UWORD y = 0;
UWORD x = 0;
void loop()
{
for (x = 0; x != WIDTH; x++)
{
for (y = 0; y != HEIGHT; y++)
{
@tahnok
tahnok / github_backup.py
Created December 29, 2018 01:58
backup your github repos periodically
import urllib2
import json
import os
user = "tahnok" #replace me
backup_path = "/home/wes/github_backups" #and replace me
repos = json.load(urllib2.urlopen("https://api.github.com/users/%s/repos?per_page=100" % user))
for repo in repos:
function sendEmail(to) {
var formLink = FormApp.getActiveForm().getPublishedUrl();
var subject = "Makerspace Inventory";
var htmlBody = "Please fill out <a href=" + formLink + ">this form</a>";
MailApp.sendEmail({
to: to,
subject: subject,
htmlBody: htmlBody
});
}