Skip to content

Instantly share code, notes, and snippets.

View andriesss's full-sized avatar

Andriesss andriesss

  • Egeniq
  • Belgium
View GitHub Profile
public function getChangedReadStreams()
{
$read = array($this->socket);
$write = array();
$except = array();
return stream_select($read, $write, $except, 5);
}
/**
<?php
namespace Anse\Xmpp;
use Anse\Xmpp\Message\MessageInterface;
class Stream
{
/**
* @var string
<?php
interface Mikado
{
public function searchFreeStick();
public function removeStick($i);
}
class MikadoCollectionQueue implements Mikado
{
<?php
/**
$stream = new Modbus('127.0.0.1');
$stream->connect();
//var_dump($stream->writeSingleRegister(10, 10, 1));
var_dump($stream->writeSingleCoil(1, 0));
var_dump($stream->readCoil(1, 1));die;
**/
<?php
$user = new User();
$user->addComment(new Comment('foo'));
$user->addComment(new Comment('baz'));
$user->addComment(new Comment('bar'));
$em->persist($user); // i only want the "user" object to be persisted, not the whole object graph
$em->flush();
@andriesss
andriesss / gist:4327496
Created December 18, 2012 12:13
PHP crashes when I try to add a PHPUnit test to the stack.
System
- Provider
[ Name] Application Error
- EventID 1000
[ Qualifiers] 0
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
<?php
namespace Stca\Form\Element;
class RenderViewScript extends \Zend_Form_Element
{
/**
* File name of view script
* @var string
*/
<?php
/*
I would like to obtain the following elements:
<input type="text" name="foo[1]" />
<input type="text" name="bar[1]" />
*/
@andriesss
andriesss / gist:4745015
Last active December 12, 2015 08:38
PHPUnit feature request to allow for docblock output while running tests
<?php
class UserTest extends PHPUnit_Extensions_SeleniumTestCase
{
/**
* Navigate to the registration page, and enter the following data in the registration form:
*
* - email: user@example.com
* - name: John Doe
*