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/bash | |
if [ -z "$1" ]; then | |
echo "missing org name" | |
exit 1 | |
else | |
name=$1 | |
fi | |
if [ -z "$2" ]; then |
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
// Today's time is needed to get the bounding for the request | |
$currentTime = time(); | |
// Beginning and end of the day | |
$startTime = strtotime("midnight", $currentTime); | |
$endTime = strtotime("tomorrow", $startTime); | |
$smon = date("m", $startTime)-1; | |
$sday = date("d", $startTime); | |
$syear = date("Y", $startTime); |
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
$("th input[type='checkbox']").on("click",function(){ | |
var col = $(this).parent().children().index($(this)); | |
var checked = $(this).is(":checked"); | |
$(this).closest("table").find("tr td:nth-child("+col+") input[type=checkbox]").prop("checked", checked); | |
}) |
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
var Quarter = function(year, quarter){ | |
this.year = year; | |
this.quarter = quarter; | |
this.str = function(){ | |
return this.year+"_"+this.quarter; | |
} | |
this.increase = function(){ |
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 findValues(obj, key){ | |
return findValuesHelper(obj, key, []); | |
} | |
function findValuesHelper(obj, key, list) { | |
if (!obj) return list; | |
if (obj instanceof Array) { | |
for (var i in obj) { | |
list = list.concat(findValuesHelper(obj[i], key, [])); | |
} |
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 callJsonp(url, callbackFunc){ | |
var callbackName; | |
if (callbackFunc == null || callbackFunc.length == 0){ | |
callbackName = "dummy"; | |
} | |
else if (typeof(callbackFunc) == "function"){ | |
callbackName = functionName(callbackFunc); | |
if (window[callbackName] == undefined){ | |
callbackName = 'jsonp_callback_' + Math.floor(Math.random() * 100000); |
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(){ // on dom ready | |
var html = layouts.reduce(function(a,e,i){return a+"<a onclick='setLayout("+i+")'>"+e+"</a> - "},"Layouts:") | |
$("#cy").before(html); | |
}); // on dom ready | |
var layouts = [ 'concentric', | |
'breadthfirst', |