Skip to content

Instantly share code, notes, and snippets.

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')
#!/usr/bin/env python
from flask import Flask, Response
from metrics import setup_metrics
app = Flask(__name__)
View ShaftController.php
class ShaftContoller
protected $elevators = [];
public function addRequest($request)
if ($request->floor > 0) {
king724 / gist:1964564
Created Mar 3, 2012
Find the dates of a repeating event
View gist:1964564
* 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