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
@m4rw3r
m4rw3r / gist:917895
Created Apr 13, 2011
Router cache file generated by InjectFramework
View gist:917895
<?php
/**
* Route cache file generated on 2011-04-13 18:33:34 by Inject Framework Router
* (Inject\Web\Router\Generator).
*/
/*
Routes.php:
$this->root()->to('Test#index');
@m4rw3r
m4rw3r / gist:987491
Created May 23, 2011
Starcraft2 Tournament helper system specifications
View gist:987491

StarCraft 2 Bracket and Map-choosing system

This is just an attempt at a half-serious project, will probably try to make one as a test for my PHP Framework while I'm working on that.

Specifications

View gist:1084295
<?php
// Rules:
$this->root()->to('Test#index');
$this->match('archive/:year/:month', array('year' => '\d{4}', 'month' => '1[0-2]|0[1-9]'))
->to('Blog#archive')->name('blog_archive');
// Mount a callback (only string-callbacks are allowed, so no objects or closures yet)
View gist:1102591
object(Inject\Router\RegExp\Result)#2 (3) {
["delimiter"]=>
string(1) "/"
["modifiers"]=>
array(2) {
["PCRE_CASELESS"]=>
string(1) "i"
["PCRE8"]=>
string(1) "u"
}
View gist:1103010
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]=>
View gist:1129436
<?php
function($url)
{
$matches = array();
if(isset($url[0]) && $url[0] == "/")
{
if(isset($url[1]) && $url[1] == "t")
{
View gist:1129440
<?php
function($url)
{
$matches = array();
if(isset($url[0]) && $url[0] == "/")
{
if(isset($url[1]) && $url[1] == "u")
{
View gist:1144082
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 Aug 16, 2011
Code generated by Inject\Router\CompilingDynamic
View gist:1148820
<?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 Aug 17, 2011
Diff to remove the need of sorting the list before calls
View Evenement1.diff
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();
You can’t perform that action at this time.