Skip to content

Instantly share code, notes, and snippets.

var ReasonSwitch = function(reasons) {
this.on = !!reasons.length;
this.reasons = reasons; //reasons
this.bias = 'off'; //implement later, are reasons to stay on or off
this.on = function(reason) {
var reasons = this.reasons;
var switched = false; //default
<?php
function range_parse($date, $default_year) {
$get_month_num = function($month_name) {
$month_num = false; //default
for($i=1; $i <= 12; $i++) {
$month_start = mktime(12,0, 0, $i, 1);
$month_long = date('F', $month_start);
$month_short = date('M', $month_start);
$month_long = mb_strtolower($month_long);