Skip to content

Instantly share code, notes, and snippets.

View crisu83's full-sized avatar
🎩
Coding

Christoffer Niska crisu83

🎩
Coding
View GitHub Profile
@crisu83
crisu83 / Reply.php
Created June 27, 2013 19:54
Example file generated by yii-app Gii model generator.
<?php
/**
* This is the model class for table "reply".
*
* The followings are the available columns:
* @property string $id
* @property string $threadId
* @property string $alias
* @property string $subject
@crisu83
crisu83 / CoalmineErrorHandler.php
Last active December 19, 2015 01:59
Coalmine error handler for Yii.
<?php
Yii::setPathOfAlias('Coalmine', __DIR__ . '/../lib/Coalmine');
/**
* Coalmine error handler.
*
* Example configuration:
*
* 'errorHandler' => array(
@crisu83
crisu83 / WeightBehavior.php
Created July 2, 2013 18:07
Weight behavior
<?php
class WeightBehavior extends CActiveRecordBehavior
{
/**
* @var string the name of the weight attribute.
*/
public $weightAttribute = 'weight';
/**
<?php
namespace Crisu83\PhpExpression;
/**
* Class that represents a php expression.
*/
class Expression
{
/**
<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
require_once(__DIR__ . '/src/Crisu83/PhpExpression/Expression.php');
require_once(__DIR__ . '/src/Crisu83/PhpExpression/Exception/NotSafe.php');
require_once(__DIR__ . '/src/Crisu83/PhpExpression/Exception/Runtime.php');
require_once(__DIR__ . '/src/Crisu83/PhpExpression/Exception/Syntax.php');
<?php
/**
* 'filters' => array(
* 'myFilter' => array(
* array('thumbnail', 'width' => 120, 'height' => 90, 'mode' => 'inset'),
* ),
* ),
*/
use Imagine\Filter\FilterInterface;
@crisu83
crisu83 / DeployCommand.php
Created July 23, 2013 14:59
Console command for creating, activating and deleting environments.
<?php
/**
* DeployCommand class file.
* @author Christoffer Niska <christoffer.niska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2013-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package crisu83.yii-deploy.commands
*/
/**
@crisu83
crisu83 / ProcessCommand.php
Last active December 20, 2015 06:39
Process console command for Yii.
<?php
/**
* ProcessCommand class file.
* @author Christoffer Niska <christoffer.niska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2013-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package crisu83.yii-deploymenttools.commands
*/
/**
<?php
use Codeception\Util\Stub;
Yii::import('bootstrap.helpers.TbHtml');
Yii::import('bootstrap.tests.unit.Dummy');
class TbHtmlTest extends \Codeception\TestCase\Test
{
/**
* @var \CodeGuy
<?php
namespace Codeception\Module;
class CodeHelper extends \Codeception\Module
{
/**
* @param \Symfony\Component\DomCrawler\Crawler $node
* @param string $text
*/
public function seeNodeText($node, $text)