This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Assumtions: | |
* IoC Container setup under $container | |
* EntityManager interface with 2 classes: | |
* - Traditional Storage | |
* - MongoDB | |
* 2 Services in IoC | |
* - services.user injects the Traditional Storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ServerInterface { | |
/** | |
* This is called at the end of every request, to determine wether to continue | |
* with the event loop. Returns true to conitune, false to stop. | |
* | |
* @return bool | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write /Applications/iTerm.app/Contents/Info LSUIElement true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fn1 = function() { | |
yield 'foo'; | |
yield 'bar'; | |
yield 'bar'; | |
}; | |
$fn2 = function() use ($fn1) { | |
yield 'baz'; | |
yield from $fn1(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function changeMe($o) { | |
$o->name = "changed"; | |
} | |
$object_1 = new StdClass(); | |
$object_1->name = "original"; | |
changeMe($object_1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Requires classes from previous gist **/ | |
/** | |
* Express lightweight wrapper around Server | |
*/ | |
class Express extends Server implements ServerInterface { | |
/** | |
* Routing default registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BEM = { | |
block: (b) => { | |
const modifier = function (m, c) { | |
if (m.toString() === '[object Object]') return this.ms(m); | |
if (!c && c !== undefined) { | |
return this; | |
} | |
return `${this} ${this}--${m}`; | |
}; | |
const modifiers = function (m) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function *traverse(item) { | |
for ( var child of item.children ) { | |
if (child.className) { | |
yield* child.classList; | |
} | |
if (child.childElementCount !== 0) { | |
yield* traverse(child); | |
} | |
} | |
} |
I hereby claim:
- I am stephenwf on github.
- I am stephenwf (https://keybase.io/stephenwf) on keybase.
- I have a public key ASB4TEHYRhc11RCXXjmjIQdtlQcwz_x2uBu37jkseKRa8go
To claim this, I am signing this object:
OlderNewer