Skip to content

Instantly share code, notes, and snippets.

View king724's full-sized avatar

Kevin King king724

View GitHub Profile
import time
import sys
import os
from flask import request
import statsd
statsd_host = os.getenv('STATSD_UDP_HOST', 'localhost')
statsd_port = os.getenv('STATSD_UDP_PORT', 8125)
c = statsd.StatsClient(statsd_host, statsd_port, prefix='testapp')
king724 /
Last active September 7, 2018 17:50
#!/usr/bin/env python
from flask import Flask, Response
from metrics import setup_metrics
app = Flask(__name__)
king724 / gist:1964564
Created March 3, 2012 05:33
Find the dates of a repeating event
* Find dates of repeating events between two dates
function find_recurring_dates($start_date, $end_date, $repeat_days){
$start = new DateTime($start_date);
$end = new DateTime($end_date);
// Find the number of days inbetween