Skip to content

Instantly share code, notes, and snippets.

# diff all
# Betaflight / OMNIBUS (OMNI) 4.0.2 May 5 2019 / 12:07:33 (56bdc8d26) MSP API: 1.41 / FEATURE CUT LEVEL 9
batch start
defaults nosave
mcu_id 001f001d5734570820363930
name QX65
feature -RX_PPM
feature -AIRMODE
feature RX_SERIAL
@th0ma5w
th0ma5w / addon.py
Created August 30, 2018 04:53
MSNBC Audio Kodi Plugin
import json, urllib2, sys, xbmcgui, xbmcplugin
opener = urllib2.build_opener()
opener.addheaders = [('User-Agent', 'CURL')]
tunein_json_url = "https://tunein.com/tuner/tune/?tuneType=Station&preventNextTune=true&waitForAds=false&audioPrerollEnabled=false&partnerId=qZjjnm85&stationId=297990"
tunein_data = json.loads(opener.open(tunein_json_url).read())
stream_url = tunein_data["DirectStreams"][0]["Url"]
addon_handle = int(sys.argv[1])
xbmcplugin.setContent(addon_handle, 'movies')
@th0ma5w
th0ma5w / tzumi_server.py
Created June 10, 2018 23:54
Single Page Web Application and REST API for TzumiMagicTV
# th0ma5w at github
#
# requires:
# http://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/zlib_1.2.7-1_ar71xx.ipk
# http://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/python-mini_2.7.3-1_ar71xx.ipk
#
# python ./tzumi_server.py
#
import socket
@th0ma5w
th0ma5w / test6.py
Last active December 3, 2017 21:36
A Larsen Effect pattern using MQTT, Differencing LED state, and Protobufs
import paho.mqtt.client as mqtt
import time
bot_reply = None
def update_reply(msg):
global bot_reply
bot_reply=msg.decode('utf-8')
topics = {
@th0ma5w
th0ma5w / xmas_lights.proto
Created December 3, 2017 21:25
A protobuf for describing LED strip control messages
syntax = "proto2";
message led {
required uint32 led = 1;
required uint32 red = 2;
required uint32 green = 3;
required uint32 blue = 4;
required uint32 intensity = 5;
}
@th0ma5w
th0ma5w / is_the_sun_up.py
Created December 3, 2017 21:15
Is the sun up in Columbus? Using PyEphem to figure it out
import ephem
def is_the_sun_up():
columbus = ephem.city('Columbus')
sun = ephem.Sun()
columbus.pressure = 0
sun.compute(columbus)
twilight = -6 * ephem.degree
return sun.alt > twilight
(ns quiltest.core
(:require
[quil.core :as q]
[quil.applet :as qa]
)
(:import
[javax.swing JFrame])
)
@th0ma5w
th0ma5w / comparer.py
Created April 8, 2014 23:00
CSV logging script for stock dump1090
#!/usr/bin/python
#
# CSV logging script for stock dump1090
#
# Uses the Requests library to compare the state of planes in view
# and prints changes to standard out
#
# Start dump1090
# modify this script to point to your dump1090 URL if different
# run the script and pipe the output to a file eg:
@th0ma5w
th0ma5w / easing.py
Created March 31, 2014 01:32
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
@th0ma5w
th0ma5w / tiles.clj
Created March 27, 2014 19:22
Tile Server Quad Tree Math
(import 'java.lang.Math)
(defn tile-count [z]
(Math/pow 2 z))
(defn deg2num [lat_deg lon_deg z]
(let [lat_rad (Math/toRadians lat_deg)
n (tile-count z)
x (int (* (/ (+ lon_deg 180.0) 360.0) n))
y (int