This file contains hidden or 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 | |
| use Illuminate\Contracts\Support\Arrayable; | |
| use Illuminate\Contracts\Support\Jsonable; | |
| use JsonSerializable; | |
| class AbstractDto extends ArrayableJsonableObject implements \ArrayAccess | |
| { | |
| public function __construct(array $properties = []) | |
| { |
This file contains hidden or 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 | |
| namespace Foo; | |
| use BadMethodCallException; | |
| use Closure; | |
| use DomainException; | |
| /* | |
| * This example encapsulates before/after method call callbacks inside a the service itself, using a proxy, |
This file contains hidden or 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
| #! /usr/bin/env php | |
| <?php | |
| // Usage: composer-box <package-name>:<version> [<config>] [<output>] | |
| ini_set('phar.readonly', false); | |
| $WORKING_DIR = realpath(dirname(__FILE__)); | |
| $ROOT_DIR = realpath($WORKING_DIR . '/../'); | |
| $TMP_DIR = "${ROOT_DIR}/tmp"; | |
| $BUILD_DIR = "${ROOT_DIR}/build"; |
This file contains hidden or 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
| /*! | |
| * ES6 ScriptLoader snippet | |
| * (c) Javier Aguilar mjolnic.com | |
| * License: MIT (http://www.opensource.org/licenses/mit-license.php) | |
| * Source: https://gist.github.com/mjolnic/93cc837dd2213ec0636a | |
| */ | |
| window.ScriptLoader = function () { | |
| /** | |
| * | |
| * @param {string} url |
This file contains hidden or 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 | |
| /** | |
| * Annotations support for PHP. | |
| * Class based on the Nette Framework annotation parser. | |
| */ | |
| class AnnotationParser | |
| { | |
| /** @internal single & double quoted PHP string */ | |
| const RE_STRING = '\'(?:\\\\.|[^\'\\\\])*\'|"(?:\\\\.|[^"\\\\])*"'; |
This file contains hidden or 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 | |
| /** | |
| * A simple "StopWatch" class to measure PHP execution time. | |
| * The class can handle multiple separate timers at the same time. | |
| */ | |
| class StopWatch { | |
| /** | |
| * @var $start float The start time of the StopWatch | |
| */ |
This file contains hidden or 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
| /* From: http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height */ | |
| /* columns of same height styles */ | |
| .container-xs-height { | |
| display:table; | |
| padding-left:0px; | |
| padding-right:0px; | |
| } | |
| .row-xs-height { | |
| display:table-row; |
This file contains hidden or 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
| // this demo works in http://html2canvas.hertzen.com/examples.html | |
| var $w = window; | |
| html2canvas($('.btn:first').get(0), { | |
| onrendered: function(canvas) { | |
| var win = $w.open(); | |
| win.document.write('<img src="'+canvas.toDataURL("image/png")+'"/>'); | |
| } | |
| }); |
This file contains hidden or 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
| search: \$_SERVER\[\'([A-Z_]{1,})\'] | |
| replace: \$this\-\>app\-\>server\(\'$1\'\) |
This file contains hidden or 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 | |
| /** | |
| * Event dispatcher | |
| * | |
| */ | |
| class EventDispatcher { | |
| public $handlers = array(); | |
| public $emitted = array(); |