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
<?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
defaults write /Applications/iTerm.app/Contents/Info LSUIElement true |
This file has been truncated, but you can view the full file.
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
global.process.versions = {}; | |
global.process.versions.node = false; | |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.bundle2 || (g.bundle2 = {})).js = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof notrequire=="function2"&¬require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof notrequire=="function"&¬require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(notrequire,module,exports){ | |
/////////////////////////////////////////////////////////////////// |
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 | |
$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
function *traverse(item) { | |
for ( var child of item.children ) { | |
if (child.className) { | |
yield* child.classList; | |
} | |
if (child.childElementCount !== 0) { | |
yield* traverse(child); | |
} | |
} | |
} |
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) { |
OlderNewer