View clone.sh
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "missing org name" | |
exit 1 | |
else | |
name=$1 | |
fi | |
if [ -z "$2" ]; then |
View location.php
// 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); |
View toggleCheckbox
$("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); | |
}) |
View quartrer.js
var Quarter = function(year, quarter){ | |
this.year = year; | |
this.quarter = quarter; | |
this.str = function(){ | |
return this.year+"_"+this.quarter; | |
} | |
this.increase = function(){ |
View find_values.js
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, [])); | |
} |
View call_jsonp.js
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); |
View switcher.js
$(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', |