Skip to content

Instantly share code, notes, and snippets.

$ phing -f test.xml
Buildfile: test.xml
[PHP Error] Argument 1 passed to Mapper::__construct() must be an instance of Project, none given, called in vendor/phing/phing/classes/phing/Project.php on line 767 and defined [line 52 of vendor/phing/phing/classes/phing/types/Mapper.php]
test > test:
[copy] Copying 1 file to /tmp
BUILD FINISHED
<?php
require __DIR__.'/vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
// Create a blob of data for testing
$data = '';
for ($i = 1; $i <= 8; $i++) $data .= $i.str_repeat("\0", 1022)."\n";
@cs278
cs278 / gist:3047451
Created July 4, 2012 13:52
Composer upper case branch test case #872
#!/bin/bash
DIR=$(mktemp -t -d composer.XXX)
# Change me if required
COMPOSER_BIN=${COMPOSER_BIN:-$(which composer)}
echo "Running test case in '$DIR' against $($COMPOSER_BIN --version)"
git init "$DIR/dependency"
<?php
class Foo
{
public function __set($method, Closure $callback) {
$this->methods[$method] = $callback->bindTo($this, $this);
}
public function __call($method, $args) {
return call_user_func_array($this->methods[$method], $args);
}
{
"monolog/monolog": {
"description": "Logging for PHP 5.3",
"maintainers": [
{
"email": "[email protected]",
"name": "Seldaek"
}
],
"name": "monolog/monolog",
@cs278
cs278 / dovecot-maildir-compress.sh
Created December 17, 2011 15:52
Compresses email in maildir format
#!/bin/sh
# Find the mails you want to compress in a single maildir.
#
# Skip files that don't have ,S=<size> in the filename.
#
# Compress the mails to tmp/
#
# Update the compressed files' mtimes to be the same as they were in the original files (e.g. touch command)
#
<?php
/*
if ($a == true && $b == false && $a == $b)
{
echo "Winning!\n";
}
*/
class TrueEqualsFalseTest extends PHPUnit_Framework_TestCase
Index: includes/functions_display.php
===================================================================
--- includes/functions_display.php (revision 10325)
+++ includes/functions_display.php (working copy)
@@ -222,9 +222,24 @@
$subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
$subforums[$parent_id][$forum_id]['children'] = array();
- if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index'])
+ // Only grab this data if we actually display subforums
@cs278
cs278 / out-1
Created September 24, 2011 23:32
chris@kinslayer:~/projects/phpbb/phpbb3 (develop-olympus) $ php -r 'date_default_timezone_set("Asia/Tokyo"); var_dump(gmdate("c"), date("c", gmdate("U") - date("Z")));'
string(25) "2011-09-24T23:31:48+00:00"
string(25) "2011-09-24T23:31:48+09:00"
chris@kinslayer:~/projects/phpbb/phpbb3 (develop-olympus) $ php -r 'date_default_timezone_set("Pacific/Auckland"); var_dump(gmdate("c"), date("c", gmdate("U") - date("Z")));'
string(25) "2011-09-24T23:31:59+00:00"
string(25) "2011-09-24T22:31:59+12:00"
@cs278
cs278 / hook_disable-delayed-redirects.php
Created February 16, 2010 20:58
phpBB Hook - Disables delayed redirects.
<?php
/**
* @package phpBB
* @copyright (c) 2010 Chris Smith
* @license http://sam.zoy.org/wtfpl/COPYING
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See