Skip to content

Instantly share code, notes, and snippets.

header('Content-type: image/jpeg');
$im = imagecreatefromjpeg('test.jpg');
imagefilter($im, IMG_FILTER_GRAYSCALE);
imagefilter($im, IMG_FILTER_CONTRAST, 255);
imagefilter($im, IMG_FILTER_NEGATE);
imagefilter($im, IMG_FILTER_COLORIZE, 55, 157, 18);
imagefilter($im, IMG_FILTER_NEGATE);
return Response::forge(imagejpeg($im));
<?php
class Controller_Decode extends Controller {
public function action_iso()
{
$content = file_get_contents(DOCROOT.'files/decode/vins.sql');
$content = utf8_decode($content);
exit($content);
return Response::forge(View::forge('decode/iso', array('content' => $content), false));
@ronan-gloo
ronan-gloo / gist:950500
Created May 1, 2011 13:29
Fuel Inflector suggestion
<?php
/**
* plural_or_singular function.
* Call singularize or pluralize method by counting a num or an array.
*
*
* @param int $count (default: 1) string, int or array: the value to count
* @param string $str (default: '') string to pluralize / singularize
* @param bool $w_count (default: false) Determine if the function returns the count
* @param string $sep (default: ' ') count - string separator
$serie['data'] = array(
array('value 1', 20),
array('value 2', 45),
array('other 3', 60)
);
$this->highcharts->set_type('pie');
$this->highcharts->set_serie($serie);
$data['charts'] = $this->highcharts->render();