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
<h1>Bookmarklets</h1> | |
<p>Usefull bookmarklets. Drag & drop them to your bookmark bar and then use whenever needed</p> | |
<ul> | |
<li><a href="javascript:var s = document.createElement('script'); s.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'; document.body.appendChild(s)">Add jQuery</a> - adds jQuery to current page | |
<li><a href="javascript:$.post("http://ladenka.juzna.cz/record/add?message="+$("#netteBluescreenError p")[0].firstChild.nodeValue.trim(),{content:document.getElementById("netteBluescreen").innerHTML},function(a){if(a&&a.link){window.open(a.link)}else{alert("Uploaded failed")}})">Share BlueScreen</a> - share Nette BlueScreen to the cloud (https://github.com/nette/nette/pull/717) |
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 | |
/** | |
* Experiment: constructor to have already partially initialized object, before it gets called. | |
*/ | |
class Foobar { | |
private $a; | |
private $b; | |
private $c; |
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 | |
/** | |
* Example of what a decent Dependency Injection Container should inject to make our life happier | |
*/ | |
class MyTest { | |
public function __construct(\Nette\Security\User $user) { // Constructor injection | |
} | |
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 \Doctrine\ORM\Event\LoadClassMetadataEventArgs; | |
use Nette, | |
Doctrine, | |
Doctrine\ORM\Events; | |
/** | |
* Updates custom repository class definition if explicitly defined in parent class |
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 | |
/** | |
* Class loader for the whole application | |
* | |
* Makes sure all the classes are available when they're needed. No less, no more. | |
* Usually the first file to load in your app | |
* | |
* @author Jan Dolecek <[email protected]> | |
* @author Filip Procházka ([email protected]) | |
*/ |
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 = new ArrayObject(array( | |
'single' => "ahoj", | |
'double' => "lamo", | |
)); | |
$b = new ArrayObject(array( | |
'single' => "zdar", | |
'double' => "vole", |
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
<? | |
$dbHost = 'localhost'; | |
$dbUser = '...'; | |
$dbPass = '...'; | |
$dbDatabase = '...'; |
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 | |
class Tool { | |
/** | |
* @return Tool[][] | |
*/ | |
function getItems() { | |
return call_user_func('x'); // dummy | |
} | |
} |
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
/** | |
* Handle action, only valid for a logged-in user | |
* @User | |
*/ | |
public function handleLike($itemId) { ... } |
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 MyApp; | |
/** | |
*/ | |
class Object { | |
function isThisAnObject() { | |
} | |
} |