Skip to content

Instantly share code, notes, and snippets.

*Directions to Kincaid’s*
60 Bay View Place
Burlingame, CA 94010
From the South:
Take Highway 101 North
Take the Anza Blvd. exit
Turn right onto Airport Blvd.
Turn left onto Bay View Place
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 ...
@kirkouimet
kirkouimet / aspect-ratio-rounded.php
Created November 15, 2011 07:01
aspectRatioRounded
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);
@kirkouimet
kirkouimet / php-analytics.php
Created November 14, 2011 04:17
PHP analytics function
function getAnalytics() {
$user = $_SERVER['HTTP_USER_AGENT'];
$browser = 'Unknown';
$platform = 'Unknown';
$version= '';
// First get the platform?
if(preg_match('/linux/i', $user)) {
$platform = 'Linux';
}