Skip to content

Instantly share code, notes, and snippets.

View uwekamper's full-sized avatar
🤩
Happy happy, joy joy!

Uwe Kamper uwekamper

🤩
Happy happy, joy joy!
View GitHub Profile
@uwekamper
uwekamper / matelight.rb
Last active August 29, 2015 13:56
Matelight in Ruby
require 'socket'
# 3 colors by 30 pixels by 16 pixels + 4 bytes of checksum (which is never checked) = 1924 byts
frame = (1..1924).map{|x|"\xFF"} * ""
u1 = UDPSocket.new
u1.send a, 0, "matelight", 1337
# For the emulator use:
u1.send a, 0, "127.0.0.1", 1337
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import socket
import colorsys # for HSV-to-RGB-conversion
UDP_IP = "10.0.0.200"
UDP_PORT = 1337
ROWS = 16
@uwekamper
uwekamper / export-placemarks.py
Created June 7, 2012 20:28
Export placemarks from KML-file
#!/usr/bin/python
import os, sys
import xml.etree.ElementTree as ET
tree = ET.parse("filename.kml")
places = list(tree.iter('{http://earth.google.com/kml/2.0}Placemark'))
print '"name", "longitude", "latidude", "elevation"'