Skip to content

Instantly share code, notes, and snippets.

View shubhamjain's full-sized avatar

Shubham Jain shubhamjain

View GitHub Profile
@shubhamjain
shubhamjain / SMQT.js
Created July 2, 2014 19:00
Successive Mean Quantization Transform
function addUp(a, b, c)
{
catArr = b.concat(c);
for(i = 0; i < catArr.length ; i++)
a[i] += catArr[i];
return a;
}
@shubhamjain
shubhamjain / Human readable time format in Javascript.
Last active August 29, 2015 13:57
This function takes milliseconds as input and converts it into human readable form. Useful in showing time elapsed or ETA.
/**
* This function takes milliseconds as input and converts it into "D H M S ms" format.
*
* @author Shubham Jain <shubham.jain.1@gmail.com>
* @license MIT License
*/
function timeFormat( miliseconds )
{
formatArr = {
"d": 24 * 60 * 60 * 1000,