View gist:3146270
me: hey another win for Scan this month: our latest invoice from our lawyers was only $65 | |
Ben: aaah nice! | |
me: lowest one ever | |
Ben: that must have been like one of the lawyers had a dream and we were in it, so he charged 65 | |
... checks invoice on Dropbox ... |
View aspect-ratio-rounded.php
public static function aspectRatioRounded($a, $b) { | |
$total = $a + $b; | |
for($i = 1; $i <= 40; $i++) { | |
$arx = $i * 1.0 * $a / $total; | |
$brx = $i * 1.0 * $b / $total; | |
if($i == 40 || ( | |
abs($arx - round($arx)) <= 0.02 && | |
abs($brx - round($brx)) <= 0.02)) { | |
# Accept aspect ratios within a given tolerance | |
return round($arx).'x'.round($brx); |
View php-analytics.php
function getAnalytics() { | |
$user = $_SERVER['HTTP_USER_AGENT']; | |
$browser = 'Unknown'; | |
$platform = 'Unknown'; | |
$version= ''; | |
// First get the platform? | |
if(preg_match('/linux/i', $user)) { | |
$platform = 'Linux'; | |
} |
NewerOlder