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
<?php
/*
* 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
<?php
$loop = EventLoop::getDefaultLoop();
function doSomething()
{
global $loop;
// Create a recurring timer
$timer = new TimerEvent(..., 1, 1);
@m4rw3r
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));
Context_init(ctx);
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
#ifndef CARRAYMACROS_H
#define CARRAYMACROS_H 1
#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
<?php
public function getService($service)
{
if(isset($this->_instances[$service]))
{
return $this->_instances[$service];
}
if( ! isset($this->_loaders[$service]))
View gist:2604007
<?php
namespace React\EventLoop;
use libev\EventLoop;
use libev\IOEvent;
class LibevLoop
{
protected $loop = null;
@m4rw3r
m4rw3r / gist:2775309
Created May 23, 2012
InjectStack middleware for ChunkedEncoding
View gist:2775309
<?php
/*
* 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.