Skip to content

Instantly share code, notes, and snippets.

Taming Python

Philipp Klaus pklaus

Taming Python
View GitHub Profile
View gist:9099457
* Arduino Due: Reading & Writing to I2C EEPROM Version: 1.00 *
* Function : Reads and Writes to Atmel 24C64 Serial EEPROM *
* Exp. Level : Beginner/Elementary *
* Arduino IDE v1.5.2 from *
* Configuration: Arduino Due (Programming Port) on /dev/ttyACM0 *
* Operating System: Xubuntu Linux 13.10 Saucy Salamander (32-bit) *
* Created: June 13, 2013 Latest Revision: June 13, 2013 *
View hdf5_simple.cpp
#include <string>
#include <iostream>
#include "H5Cpp.h"
#define MAX_NAME_LENGTH 32
const std::string FileName("SimpleCompound.h5");
const std::string DatasetName("PersonalInformation");
const std::string member_age("Age");
const std::string member_sex("Sex");
const std::string member_name("Name");
pklaus / dictcn.js
Created Jan 24, 2010 — forked from hzmangel/x
shadow removed (+ js markup on
View dictcn.js
name: ["dictcn", "dcn"],
author: {
name: "Hu Ziming",
email: ""
contributors: ["Hu Ziming", "azuwis"],
icon : "",
description: "Consulting the word from <a href=\"\"></a>.",
help: "Consulting the word from <a href=\"\"></a>.",
pklaus / 60-lxc.conf
Created Apr 28, 2012 — forked from jersub/60-lxc.conf
Automates the steps to set up LXC containers with virtualized environments on Ubuntu Linux
View 60-lxc.conf
pklaus / JSONPSensorServer.ino
Created Oct 5, 2012 — forked from sfentress/JSONPSensorServer.ino
Arduino Server for JSON-P pin values
View JSONPSensorServer.ino
Web Server returning data as JSON-P
A simple web server that returns the value of the analog input
pins as a JSON-P object, using an Arduino Wiznet Ethernet shield.
* Ethernet shield attached to pins 10, 11, 12, 13 (standard configuration)
* Analog inputs attached to pins A0 through A5 (optional)
* Example of reading LM35 on pin A0:
pklaus / index.html
Created Oct 5, 2012 — forked from sfentress/dgApi.js
Arduino Data
View index.html
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
$(function() {
var graph = null,
formatter = null,
dataSet = [],
graphPin = null;
#!/usr/bin/env python
# Ben's Magical Perceptron
def dot_product(a, b):
return sum([a[i]*b[i] for i in range(len(a))])
def decision( x, w, theta ):
return (dot_product(x, w) > theta)
pklaus / Bash function to print black and white PNG (and JPEG, GIF, BMP) files to a networked Brother label printer (such as the QL-720NW)
# Print a black and white PNG file on the first available Brother label printer
# Requires
# Source (.) this file to set bash completion and add the print function.
function print-png-label() {
if [ -f "$1" ]; then
# Change these to match your printer:
local LBLPMODEL="QL-720NW"
local LBLPSIZE="62"
pklaus /
Last active Sep 28, 2018 — forked from larsch/
Install Arch Linux ARM for Raspberry Pi Zero W on SD Card (with commands to configure WiFi before first boot).
#!/bin/sh -exu
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
# RPi1/Zero (armv6h):
pklaus /
Last active Jan 12, 2019 — forked from anjackson/gist:2888380
Mounting a proxy server to a /path of a Bottle app
import bottle
from hacks import ProxyServer
root = bottle.Bottle()
ps = ProxyServer()
root.mount(ps.wrapped_proxy_app, "/proxyapp")
You can’t perform that action at this time.