Skip to content

Instantly share code, notes, and snippets.

Christian Stade-Schuldt Tafkas

Block or report user

Report or block Tafkas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Tafkas /
Last active Aug 29, 2015
Script to read SML data packages from a residential meter
#!/usr/bin/env python
# encoding: utf-8
Created by Christian Stade-Schuldt on 2014-10-25.
import sys
import os
import datetime
Tafkas /
Created Oct 27, 2014
Reading data from an eHZ-IW8E2A5 residential meter
# read and evaluate SML output received from EMH eHZ
# set serial device
#set $INPUT_DEV to 9600 8N1
stty -F $INPUT_DEV 1:0:8bd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
Tafkas /
Created Jul 28, 2014
Fetch current weather from openweathermap api and save it to a sqlite database
import sqlite3
import json
import urllib
import datetime
import calendar
WEATHER_DATA_URL = ',de&units=metric'
DB_PATH = ''
def get_data():
Tafkas / sun_flight_map.R
Created May 20, 2014
Plot sun elevations along a flight path.
View sun_flight_map.R
# sun_flight_map.R
# Plot sun elevations along a flight path.
# Airport information can be sourced from
# Note that the time zone offsets provided in their airports.dat never count
# daylight savings time.
# This code is for fun only, so it comes with no guarantee of accuracy and
# is not to be used for any serious purpose including making any decisions
Tafkas / decodeLine.R
Created Feb 12, 2014
Decode Encoded Polylines in R
View decodeLine.R
decodeLine <- function(encoded){
vlen <- nchar(encoded)
vindex <- 0
varray <- NULL
vlat <- 0
vlng <- 0
while(vindex < vlen){
Tafkas /
Created Jan 28, 2014
This script will access your Fitbit data via the Fitbit API and insert it into a Google spreadsheet.
This script will access your Fitbit data via the Fitbit API and insert it into a Google spreadsheet.
The first row of the spreadsheet will be a header row containing data element names. Subsequent rows will contain data, one day per row.
Note that Fitbit uses metric units (weight, distance) so you may wish to convert them.
Original script by
Original instructional video by Ernesto Ramirez at
Modifications by Mark Leavitt (PDX Quantified Self organizer)
Further Modifications by Christian Stade-Schuldt
Here's to your (quantified) health!
Tafkas / sleepdata.R
Last active Apr 4, 2016
A first look at the sleepdata recorded with the Sleep Cycle app for the iPhone
View sleepdata.R
sleep <- read.csv(file="sleepdata.csv", header=T, sep=";")
#split end time
sleep$End <- as.character(sleep$End)
#get the date
sleep$Date <- sapply(strsplit(sleep$End, " "),"[[",1)
sleep$Date <- strptime(sleep$Date, format="%Y-%m-%d")
#fix sleep quality
Tafkas / AtlanticCity10Miler.r
Created Dec 9, 2013
Some charts of the St. Pat's 10 Miler and 5K 2008
View AtlanticCity10Miler.r
data <- read.csv(file = "2008TenMiler.csv", header = TRUE, sep=",")
data <- na.omit(data)
#convert time to minutes
data$Nettime <- as.character(data$Nettime)
data$Nettime <- sapply(strsplit(data$Nettime, ":"),
function(x) {
x <- as.numeric(x)
x[1]*60 + x[2] + x[3]/60
Tafkas /
Created Dec 9, 2013
A simulation of the martingale roulette system
# encoding: utf-8
import random
import time
import matplotlib.pyplot as plt
import numpy as np
#simulates the martingale roulette system
def simulation():
Tafkas / trendweight.r
Last active Aug 31, 2018
Chart your data from with ggplot2 in R
View trendweight.r
#read data
tw <- read.csv(file="TrendWeightData.csv",header=T)
#remove interpolated values
tw <- tw[tw$WeightIsInterpolated == "False",]
#convert strings to date and extract year
tw$Date <- as.POSIXlt(as.character(tw$Date), format="%Y-%m-%d")
tw$Year <- tw$Date$year + 1900
You can’t perform that action at this time.