Skip to content

Instantly share code, notes, and snippets.

Martin Wernstål m4rw3r

Block or report user

Report or block m4rw3r

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1534999
* Generated by RapidDataMapper on 2011-11-02 13:09:36.
* Copyright (c) 2010 Martin Wernståhl.
* All rights reserved.
class ArtistCollectionBase extends Rdm_Collection
View gist:1657366
$loop = EventLoop::getDefaultLoop();
function doSomething()
global $loop;
// Create a recurring timer
$timer = new TimerEvent(..., 1, 1);
m4rw3r / php-libev API vs libev API.rst
Created Jan 27, 2012
Current feature-set of php-libev vs libev
View php-libev API vs libev API.rst

Differences in the PHP-libev vs libev API

This list is subject to change as the PHP-libev API changes. The goal of this list is to keep track of differences and see if stuff needs to change, it also serves as a todo list for stuff which currently is not implemented in PHP-libev.

View gist:2188184
Context *ctx = malloc(sizeof(Context));
uint64_t varsum = Context_allocVariable(ctx);
uint64_t varn = Context_allocVariable(ctx);
uint64_t vara = Context_allocVariable(ctx);
uint64_t varb = Context_allocVariable(ctx);
uint64_t vari = Context_allocVariable(ctx);
Instruction instructions[] = {
View gist:2238057
#include <inttypes.h>
#include <stdio.h>
#define ARRAY_SIZE(array) array ## _num
#define ARRAY_MAX(array) array ## _max
#define ARRAY_CDECL(array, type) \
View gist:2309608
# This is a comment
# Plain constant:
Dummystring = "foobar"
# Parameters to be injected from outside (CLI or another processor) and their respective types:
Parameters {
target_file: string,
integration_time: uint32
View gist:2312504
ins NOP()
/* Empty */
ins END()
goto end_eval;
View gist:2602721
public function getService($service)
return $this->_instances[$service];
if( ! isset($this->_loaders[$service]))
View gist:2604007
namespace React\EventLoop;
use libev\EventLoop;
use libev\IOEvent;
class LibevLoop
protected $loop = null;
m4rw3r / gist:2775309
Created May 23, 2012
InjectStack middleware for ChunkedEncoding
View gist:2775309
* Created by Martin Wernståhl on 2011-04-25.
* Copyright (c) 2011 Martin Wernståhl.
* All rights reserved.
namespace Inject\Stack\Middleware;
use \Inject\Stack\MiddlewareInterface;
You can’t perform that action at this time.