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
#!/bin/zsh | |
# Add the following to your ~/.gitconfig | |
# | |
# [alias] | |
# up = !zsh /path-to-this-script/git-up.sh | |
# | |
# Then you can call | |
# | |
# `git up` |
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
function computeSunrise(day, sunrise) { | |
/*Sunrise/Sunset Algorithm taken from | |
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm | |
inputs: | |
day = day of the year | |
sunrise = true for sunrise, false for sunset | |
output: | |
time of sunrise/sunset in hours */ |
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 | |
import random | |
import time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
#simulates the martingale roulette system | |
def simulation(): | |
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 | |
""" | |
slack_user_munin - A munin plugin for to monitor online presence in Slack | |
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: | |
[slack_*] |
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 | |
""" | |
slack_channel_munin - A munin plugin for to monitor channel count in Slack | |
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: | |
[slack_*] |
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 numpy as np | |
def rmsle(h, y): | |
""" | |
Compute the Root Mean Squared Log Error for hypthesis h and targets y | |
Args: | |
h - numpy array containing predictions with shape (n_samples, n_targets) | |
y - numpy array containing targets with shape (n_samples, n_targets) | |
""" |
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 | |
""" | |
collect_kostal.py | |
Created by Christian Stade-Schuldt on 2014-07-27. | |
""" | |
import urllib2 |
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
""" | |
Created by Christian Stade-Schuldt on 2014-07-28. | |
""" | |
import sqlite3 | |
import json | |
import urllib | |
import time | |
import datetime | |
import calendar |
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
/* FitbitDownload.gs | |
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 loghound@gmail.com | |
Original instructional video by Ernesto Ramirez at http://vimeo.com/26338767 | |
Modifications by Mark Leavitt (PDX Quantified Self organizer) www.markleavitt.com | |
Further Modifications by Christian Stade-Schuldt blog.tafkas.net | |
Here's to your (quantified) health! |
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
#read data | |
tw <- read.csv(file="TrendWeightData.csv",header=T) | |
summary(tw) | |
#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 |
NewerOlder