Skip to content

Instantly share code, notes, and snippets.

View fprochazka's full-sized avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
<?php
class ExtensionTest extends Tester\TestCase
{
public function testMergingMetadata_simple()
{
$compiler = new CompilerMock();
<?php
require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator;
$configurator->setDebugMode(TRUE); // debug mode MUST NOT be enabled on production server
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
<?php
/**
* @method onAttached(BaseControl $control, Nette\Application\UI\PresenterComponent $parent)
* @method \BasePresenter getPresenter()
*
* @property \BasePresenter|BaseControl[] $presenter
* @property-read \BasePresenter|BaseControl[] $presenter
* @property \Nette\Templating\FileTemplate|\stdClass $template
@fprochazka
fprochazka / ajax.overlay.js
Created May 17, 2014 12:59
Overlay-on-ajax extension for nette.ajax.js
(function ($) {
$.nette.ext('overlay', {
before: function (xhr, settings) {
if (!settings.nette || !settings.nette.el) {
return;
}
var tar = $(settings.nette.el);
var container = tar.closest('.ajax-overlay');
upstream huboard_unicorn {
server unix:/home/hosiplan/develop/testing/huboard/tmp/unicorn.huboard.sock fail_timeout=0;
}
server {
listen 127.0.0.1:80;
server_name huboard.dev;
root /home/hosiplan/develop/testing/huboard/public;
try_files $uri/index.html $uri @huboard_unicorn;
{control formProductAdd}
@fprochazka
fprochazka / test.md
Last active December 26, 2015 13:19
<?php

$article->getOne(); $article->one;
$article->getTwo(); $article->two; 
$article->getThree(); $article->three;
<?php
use Nette\Application\Routers\RouteList,
Nette\Application\Routers\Route,
Nette\Application\Routers\SimpleRouter;
use Nette\Utils\Strings;
/**
* Router factory.
@fprochazka
fprochazka / Configuration.php
Created May 12, 2013 18:33
WkhtmlToPDF abstraction that can run either localy or remotely, or even can be used as a hosted service.
<?php
/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008, 2012 Filip Procházka (filip@prochazka.su)
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/
<?php
// .phpstorm.meta.php
namespace NEON_META { // we want to avoid the pollution
$CONFIG_KEYS = [
'dibi' => [ 'host' => '', 'dbname' => '', 'user' => '', 'password' => '' ], // unobstrusive static definition
'nette' => \Nette\Config\Extensions\NetteExtension::$defaults, // no problem the property is actually not static
'nette' => [
'session' => [