Skip to content

Instantly share code, notes, and snippets.

View ThePixelDeveloper's full-sized avatar

Mathew Davies ThePixelDeveloper

View GitHub Profile
<?php defined('SYSPATH') or die('No direct script access.');
class Model_Day extends ORM {
protected $_table_columns = array(
'day' => array('data_type' => 'date', 'is_nullable' => FALSE),
'max_events' => array('data_type' => 'int', 'is_nullable' => FALSE, 'default' => 10),
);
protected $_primary_key = 'day';
protected $_has_many = array(
'event_start_day' => array('model' => 'event', 'far_key' => 'starting_day'),
<?php
/**
*
*/
public function get_ratings(Model_User $user)
{
$query = $this->reset()->select
(
'users.username',
<?php
/**
* When given a coaster ID, this method will recalculate the number of downloads
* a coaster has had. The reason for manual queries is because it's around 300% faster than
* the current method.
*
* Use this function only when you want to bulk update a lot of coasters at the
* same time.
*
* @param type $id
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Tests the coaster download policy.
*
* @package Unittest
* @author Mathew Davies
*/
class Test_Coaster_Download_Policy extends Kohana_Unittest_TestCase
{
/*
* jquery.uploadProgress
*
* Copyright (c) 2008 Piotr Sarnacki (drogomir.com)
* - Original release.
*
* Copyright (c) 2011 Mathew Davies (thepixeldeveloper@googlemail.com)
* - Refactored a lot of code into their own functions
*
* Licensed under the MIT license:
1x time spiral (NM) - 20
4x gaea's cradle (NM) - 200
1x force of will (NM) - 55-60
1x chrome mox (GP foil) - 20
1x mirror universe (NM-) - 25
1x mirror universe (italian) - 15
4x berserk (1 beta NM, 1 beta MP, 2 UL NM) - 150
2x dark ritual (beta) - 30
4x wasteland (MP) - 120
1x candelabra (MP) - 200
<?php
/*
* This file is part of the Behat\Mink.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
namespace Behat\Mink\Driver;
use Goutte\Client as GoutteClient,
Symfony\Component\BrowserKit\Client,
Symfony\Component\DomCrawler\Crawler,
Symfony\Component\DomCrawler\Field\ChoiceFormField;
use Behat\Mink\Session,
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* @package Kohana/Codebench
* @category Tests
* @author Mathew Davies <thepixeldeveloper@googlemail.com>
*/
class Bench_Resize extends Codebench
{
public $description = 'Find out the fastest possible way to create an image thumbnail.';
'SCRIPT_NAME' => string '/ö +' (length=5)
'REQUEST_URI' => string '/%C3%B6%20+' (length=11)
'DOCUMENT_URI' => string '/ö +' (length=5)
'PHP_SELF' => string '/ö +' (length=5)