Skip to content

Instantly share code, notes, and snippets.


Fabian Graßl fabeat

  • deepblue networks AG
  • Hamburg
Block or report user

Report or block fabeat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from PIL import Image
def scale(image, max_size, method=Image.ANTIALIAS):
resize 'image' to 'max_size' keeping the aspect ratio
and place it in center of white 'max_size' image
im_aspect = float(image.size[0])/float(image.size[1])
out_aspect = float(max_size[0])/float(max_size[1])
if im_aspect >= out_aspect:
View PropelObjectFormatter.php
* This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* @license MIT License
View gist:1348985
class Page extends SiteTree {
function canPublish($Member = null)
if (Director::is_cli())
return true;
View de_DE.php
global $lang;
$lang['de_DE']['Uploadify']['SUCCESSFULADDSINGLE'] = 'Datei "%s" hinzugefägt.';
$lang['de_DE']['Uploadify']['SUCCESSFULADDMULTI'] = 'Dateien hinzugefügt.';
$lang['de_DE']['Uploadify']['BUTTONTEXT'] = 'Durchsuchen';
$lang['de_DE']['Uploadify']['CHANGEFOLDERACTION'] = 'ändern';
$lang['de_DE']['Uploadify']['CHOOSEIMPORTFOLDER'] = 'Ordner wählen';
$lang['de_DE']['Uploadify']['PLEASESELECT'] = 'Ordner wählen';
$lang['de_DE']['Uploadify']['IMAGES'] = 'Bilder';
View test.php
class Foo
protected $bar = 'TEST';
$foo = new Foo();
$bar = new ReflectionProperty($foo, 'bar');
echo $bar->getValue($foo);
View input.php
$arr = array('foo ', ' bar ');
$arr = array_map(function($el){ return trim($el); }, $arr);
fabeat / gist:731908
Created Dec 7, 2010
Unit tests of protected methods in PHP
View gist:731908
class Foo
protected function bar($test)
echo $test;
fabeat / README
Created May 4, 2010
MYSQL SLUG FIX (Unique fix)
The table 'content' contains pages with a slug. This slug should be unique but it isn't.
unique_fix.sql fixes this problem and makes the slug-column unique.
You can’t perform that action at this time.