This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sun_flight_map.R | |
# | |
# Plot sun elevations along a flight path. | |
# | |
# Airport information can be sourced from http://openflights.org/data.html. | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import json | |
import urllib | |
import datetime | |
import calendar | |
WEATHER_DATA_URL = 'http://api.openweathermap.org/data/2.5/weather?q=Berlin,de&units=metric' | |
DB_PATH = '' | |
def get_data(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
pysml.py | |
Created by Christian Stade-Schuldt on 2014-10-25. | |
""" | |
import sys | |
import os | |
import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
codebase_munin - A munin plugin for Linux to monitor Codebase ticket progress | |
Copyright (C) 2015 Christian Stade-Schuldt | |
Author: Christian Stade-Schuldt | |
Like Munin, this plugin is licensed under the GNU GPL v2 license | |
http://www.opensource.org/licenses/GPL-2.0 | |
Add the following section to your munin-node's plugin configuration: | |
[codebase_*] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runs <- read.csv("myrunninglog.csv", header=T, sep=",") | |
#convert date | |
runs$Date <- strptime(as.character(runs$Date), format="%Y-%m-%d") | |
#convert distance from km to meters | |
runs$Distance <- 1000 * runs$Distance | |
ggplotRegression <- function (fit) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Distribution of Birth Year and Top 10 Participating Nations in Berlin Marathon 2014 | |
setwd("~/") | |
bm <- read.csv("BerlinMarathon2014.csv", header=T) | |
library(ggplot2) | |
p <- ggplot(bm, aes(birth_date, ..density..)) | |
p <- p + geom_histogram(binwidth=1, colour = "black", fill = "lightblue") + geom_density() | |
p + ggtitle("Distribution of Birth Year for the Berlin Marathon 2014") + xlab("Year of Birth") + ylab("Density") | |
# get the top 10 particpating nations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# encoding: utf-8 | |
""" | |
activity_extractor.py | |
Created by Christian Stade-Schuldt on 2013-10-29. | |
""" | |
import os | |
from lxml import etree as et | |
from datetime import timedelta, datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Created by Christian Stade-Schuldt on 2013-11-12. | |
""" | |
import sys | |
import os | |
import csv | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data <- read.csv(file = "2008TenMiler.csv", header = TRUE, sep=",") | |
summary(data) | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer