Skip to content

Instantly share code, notes, and snippets.

View hdragomir's full-sized avatar

Horia Dragomir hdragomir

View GitHub Profile
@hdragomir
hdragomir / image_resizer.php
Created September 2, 2010 08:48
on the fly image resizer
<?php
define('cache', realpath('./cacheddata/icons/'));
$h = 28;
$w = 28;
$iurl = &$_GET['i'];
$file = cache . DIRECTORY_SEPARATOR . sha1("$w/$h/$iurl").'.jpg';
header("Content-type: image/jpeg");
<html>
<head>
<title>prime number checker</title>
<style>
body, input{
font-family: Georgia, serif;
background-color: white;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ -->
<title>isObjectLiteral</title>
<style>
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
</style>