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 | |
use Nette\Http; | |
echo Http\Request::class; // prints 'Nette\Http\Request' since PHP 5.5 | |
echo Http\Request\type::of; // prints 'Nette\Http\Request' alwyas ;) | |
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 | |
ob_start(function($s, $flag) { | |
if ($flag & PHP_OUTPUT_HANDLER_START) { | |
$e = new \Exception; | |
$s = nl2br("Output started here:\n{$e->getTraceAsString()}\n\n") . $s; | |
} | |
return $s; | |
}, 2); |
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
<!doctype html> | |
<script> | |
if ("WebSocket" in window) { | |
var ws = new WebSocket("ws://127.0.0.1:31339"); | |
ws.onopen = function() { | |
console.log('connected'); | |
}; | |
ws.onerror = function(e) { |
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 | |
/** | |
* This file is part of the Nette Tester. | |
* Copyright (c) 2009 David Grudl (http://davidgrudl.com) | |
*/ | |
namespace Tester; | |
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
<table n:if="$items"> | |
<tr n:foreach="$items as $item"> | |
<td>{$item->title}</td> | |
... | |
</tr> | |
</table> |
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 | |
class FooControl extends Nette\Application\UIControl | |
{ | |
public function render() | |
{ | |
MyTemplate::registerFilters($this->template) | |
->render(__DIR__ . '/control.latte'); | |
} |
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
services: | |
- RouterFactory()::createRouter(%mode%)::start() | |
- MyClass( @service(123)::foo(), abc ) |
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
# spaces are OK | |
- key1: # empty means NULL | |
key2: hello | |
key3: 123 | |
# tabs are confusing | |
- key1: | |
key2: hello |
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
services: | |
newsletter_factory: NewsletterFactory | |
newsletter_manager: @newsletter_factory::get(@templating) | |
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
<td><span class=select>[email protected]</span></td> | |
<script> | |
$('.select').click(function(){ | |
var range = document.createRange(); | |
range.selectNodeContents(this); | |
window.getSelection().addRange(range); | |
}); |