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
root@precise32:/vagrant# npm install
npm WARN cannot run in wd microflo@0.2.1 node microflo.js update-defs && node-gyp rebuild (wd=/vagrant)
npm WARN package.json component-coffee@0.1.4 No repository field.
npm WARN package.json flowhub-registry@0.0.2 No repository field.
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/mkdirp/0.3.4
npm http GET https://registry.npmjs.org/component-require/0.3.1
npm http GET https://registry.npmjs.org/batch/0.2.1
npm http GET https://registry.npmjs.org/debug
lass LedChainWS : public Component {
public:
LedChainWS()
: Component(outPorts, 2)
, pindata(-1)
, pinclk(-1)
, number(-1)
, initialized(false)
, currentPixelAddress(-1)
#ifdef HAVE_ADAFRUIT_WS2801
@uwekamper
uwekamper / gist:9c8bdeff7f2fc999398e
Created July 5, 2014 22:39
c-base-Plasmaleitung / Space-Shlong
/**
* Plasma-Leitungs-Code für die c-base
*/
// most launchpads have a red LED
#define LED1 P1_7
#define LED2 P1_6
#define LED3 P2_5
#define LED4 P2_4
#define LED5 P2_3
@uwekamper
uwekamper / cinfowall.ino
Last active August 29, 2015 14:19
Sourcecode for the c-info-wall
/*
Fade for c-info wall at c-base
*/
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
// Apparently the preprocessor variables B0 and B1 are already taken.
// Therefore we use the prefix CBASE
@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"'
#!/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
DRACHI = """
+---------------------+
| D A N K E S C H Ö N | / \ //\\
+------------|\___/|--+ / \// .\\
\ /O O \__ / // | \ \\
\ / / \/_/ // | \ \\
@___@' \/_ // | \ \\
| \/_ // | \ \\
| \/// | \ \\
_|_ / ) // | \ _\\
@uwekamper
uwekamper / addbeat.py
Last active December 14, 2016 01:25
Loop mit Beat
from pydub import AudioSegment
sound1 = AudioSegment.from_file("loop.wav")
kick = AudioSegment.from_file("kick.wav")
snare = AudioSegment.from_file("snare.wav")
ms = len(sound1)//4
beat = AudioSegment.silent(duration=ms).overlay(kick).overlay(snare, position=ms//2) * 4
combined = (sound1.overlay(beat) * 4).fade_in(1000).fade_out(1000)
@uwekamper
uwekamper / cowtest.sh
Last active May 29, 2018 07:29
Test all the cowsay characters
#!/bin/sh
for i in `cowsay -l | tail -n +2`
do
echo $i
cowsay -f $i "Ich bin die Kuh"
sleep 3
done