Skip to content

Instantly share code, notes, and snippets.

@skorotkiewicz
Created December 8, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skorotkiewicz/99fccbf008c22bfdfca980340e53cfe2 to your computer and use it in GitHub Desktop.
Save skorotkiewicz/99fccbf008c22bfdfca980340e53cfe2 to your computer and use it in GitHub Desktop.
<?php
function hot($ups, $downs, $date) {
$s = $ups - $downs;
$order = log10(max(abs($s), 1));
if ($s > 0) {
$sign = 1;
} else if ($s < 0) {
$sign = -1;
} else {
$sign = 0;
}
$seconds = $date - time();
return round($sign * $order + $seconds / 45000, 7);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment