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 / Dockerfile
Created October 5, 2018 11:40
Dockerfile for lektor with webpack
# Build with:
# docker build -t <projectname> .
# Run with windows, untested:
# docker run --rm -it -v %cd%:/data -v /data/webpack/node_modules -p 5000:5000 -it <projectname> lektor server -f webpack --host 0.0.0.0
# Run on Uunix:
# docker run --rm -it -v $(pwd):/data -v /data/webpack/node_modules -p 5000:5000 -it <projectname> lektor server -f webpack --host 0.0.0.0
FROM python:3.6.1
models/myattachment.ini:
----------------------
[model]
name = MyAttachment
label = MyAttachment
hidden = no
[fields.description]
label = Description
type = string
@uwekamper
uwekamper / traceback.txt
Created June 13, 2018 22:25
traceback ftp lektor python3
lektor deploy --username xxxxxx --password xxxxxx
/Users/uk/.virtualenvs/xxxxxx/bin/../lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated
f = open(fullname, "rU")
Deploying to production
Build cache: /Users/uk/Library/Caches/Lektor/builds/ac23d873bd37ecb20fdd544088809b91
Target: ftps://xxxxxx/
000 Connecting to server ...
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 00:23. Server port: 21.
@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
@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)
DRACHI = """
+---------------------+
| D A N K E S C H Ö N | / \ //\\
+------------|\___/|--+ / \// .\\
\ /O O \__ / // | \ \\
\ / / \/_/ // | \ \\
@___@' \/_ // | \ \\
| \/_ // | \ \\
| \/// | \ \\
_|_ / ) // | \ _\\
#!/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"'
@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 / 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