This file contains hidden or 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 timeSince(timeStamp) { | |
var now = new Date(), | |
secondsPast = (now.getTime() - timeStamp.getTime()) / 1000; | |
if(secondsPast < 60){ | |
return [-parseInt(secondsPast), 'seconds'] | |
} | |
if(secondsPast < 3600){ | |
return [-parseInt(secondsPast/60), 'minutes'] | |
} | |
if(secondsPast <= 86400){ |
This file contains hidden or 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/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by git-commit with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, make this file executable. | |
if git-rev-parse --verify HEAD 2>/dev/null |
This file contains hidden or 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
/* | |
* Finished: 30 min | |
*/ | |
function countOfSymbol(arr) { | |
let filter2 = (v) => v == '2' | |
return arr.map((v) => v.toString().split('')) | |
.reduce((prev, curr) => prev.filter(filter2).length >= curr.filter(filter2).length ? prev : curr, []) | |
.join('') || null | |
} |