Skip to content

Instantly share code, notes, and snippets.

@hskrasek
hskrasek / gist:03392a6f9d7b8cd2892d
Created August 7, 2014 16:31
Terry's interesting thing.
<?php
$user = new User;
$includes = "users,posts,comments";
call_user_func_array([$user, 'with'], explode(',', $includes));
$user->find(1);
@matula
matula / gist:4454829
Last active December 10, 2015 15:29
A simple PHP function that take an array of CSS values and puts them into relevant media queries
<?php
function parseCss($css = array()) {
// Init
$return = array();
// Set the break points here
$return['default'] = '';
$return['tablet'] = '@media only screen and (max-width : 1024px) {';
$return['phone'] = '@media only screen and (min-width : 320px) and (max-width : 480px) {';
@kemo
kemo / fix.diff
Last active July 16, 2018 06:47
Kohana 2 ob_end_clean() hotfix (PHP 5.4+)
diff --git a/system/core/Kohana.php b/system/core/Kohana.php
index 271f917..287c271 100644
--- a/system/core/Kohana.php
+++ b/system/core/Kohana.php
@@ -722,7 +722,7 @@ final class Kohana {
if (ob_get_level() >= self::$buffer_level)
{
// Set the close function
- $close = ($flush === TRUE) ? 'ob_end_flush' : 'ob_end_clean';
+ $close = ($flush === TRUE) ? 'ob_end_flush' : 'Kohana::_ob_end_clean';