Skip to content

Instantly share code, notes, and snippets.

object(Inject\Router\RegExp\RegExp)#1 (3) {
["pattern":protected]=>
object(Inject\Router\RegExp\Pattern)#2 (1) {
["parts":protected]=>
array(9) {
[0]=>
string(2) "\/"
[1]=>
string(1) "f"
[2]=>
<?php
function($url)
{
$matches = array();
if(isset($url[0]) && $url[0] == "/")
{
if(isset($url[1]) && $url[1] == "t")
{
<?php
function($url)
{
$matches = array();
if(isset($url[0]) && $url[0] == "/")
{
if(isset($url[1]) && $url[1] == "u")
{
Sampling process 20014 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Chocolat (pid 20014) every 1 millisecond
Process: Chocolat [20014]
Path: /Applications/Chocolat.app/Contents/MacOS/Chocolat
Load Address: 0x100000000
Identifier: com.chocolatapp.Chocolat
Version: ??? (0.0.30)
Code Type: X86-64 (Native)
Parent Process: launchd [640]
@m4rw3r
m4rw3r / gist:1148820
Created August 16, 2011 10:34
Code generated by Inject\Router\CompilingDynamic
<?php
array('GET' => function($url)
{
$matches = array();
if(isset($url[0]) && $url[0] == "/")
{
if(isset($url[1]) && $url[1] == "u" && isset($url[2]) && $url[2] == "s" && isset($url[3]) && $url[3] == "e" && isset($url[4]) && $url[4] == "r")
{
@m4rw3r
m4rw3r / Evenement1.diff
Created August 17, 2011 08:26
Diff to remove the need of sorting the list before calls
diff --git a/src/Evenement/EventEmitter.php b/src/Evenement/EventEmitter.php
index 5b8d00c..8207aaf 100644
--- a/src/Evenement/EventEmitter.php
+++ b/src/Evenement/EventEmitter.php
@@ -29,21 +29,16 @@ namespace Evenement;
class EventEmitter
{
private $listeners = array();
- private $modified = array();
<?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
{
<?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 January 27, 2012 10:34
Current feature-set of php-libev vs libev

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.

=========================================== =============================================== libev PHP-libev

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[] = {