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
// curl -k https://localhost:8000/ | |
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), | |
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') | |
}; | |
https.createServer(options, function (req, res) { |
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 | |
require "./Breto/libs/nette/loader.php"; | |
class CustomDump | |
{ | |
static public $file; | |
static function setFile($file) { | |
self::$file = $file; |
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 | |
abstract class BaseModel extends Nette\Object | |
{ | |
/** @var NotORM */ | |
protected $connection; | |
/** |
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 | |
// FileJournal for the permanent repository | |
// Copy contents of the "FileJournal.php" class, and do the changes mentioned bellow. | |
// FileJournal pro permanentní repozitář. | |
// Zkopírujte obsah souboru "FileJournal.php" a proveďte níže uvedené změny | |
namespace App; | |
class FileJournal { |
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
Foreach always creates a working copy of the array, which results in double memory usage. | |
Here are some fun things along with one WTF thingie at the end. | |
We discovered these in WDF (www.wdf.cz) during today's afternoon. | |
Outline | |
------------- | |
<?php | |
$array = array(1, 2, 3, 4, 5); | |
foreach($array as $key => $value) { | |
unset($value); |
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
/** | |
* Make table body scrollable, with the table header always visible. | |
* If no min/max-height is given, table shrinks to fit the browser viewport. | |
* | |
* requirements: | |
* - jQuery framework required (tested with 1.6.2) | |
* - header must be wrapped in <thead> element | |
* | |
* warnings: | |
* - table <caption> is not supported |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 | |
abstract class BaseModel extends Nette\Object | |
{ | |
/** @var NotORM */ | |
protected $connection; | |
/** |
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 | |
$new_ = new new_; | |
echo $new_::Test('I', 'live', '!')->get(); | |
echo $new_::NonExistsClass('I', "don't", 'live', '!')->get(); | |
echo (string)$new_::NonExistsClass('I', "don't", 'live', '!'); | |
$class = $new_::NonExistsClass('I', "don't", 'live', '!'); | |
$class::test(); | |
$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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
OlderNewer