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
{
"functionCalls": [
{
"function": "\\array_diff_assoc",
"position": 0
},
{
"function": "\\array_diff_key",
"position": 0
},
@fprochazka
fprochazka / RenderBlockHelperMacro.php
Created February 11, 2016 19:10
Vyrenderování jednoho bloku z latte šablony
<?php
use Latte;
use Latte\Compiler;
class RenderBlockHelperMacro extends \Latte\Macros\MacroSet
{
public function __construct(Compiler $compiler)
{
@fprochazka
fprochazka / PresenterInfo.php
Created November 19, 2010 01:00
PresenterTree
<?php
namespace Kdyby;
use Nette;
use Nette\Reflection\ClassType;
/**
#!/bin/bash
DOMAIN=www.rohlik.cz
REMOTE="upstream"
BRANCH="production"
REVISION=$(git --git-dir=$SOURCE/.git rev-parse HEAD | cut -c1-7)
GIT_MERGE_AUTHOR=$(git --git-dir=$SOURCE/.git --no-pager show -s --format='%an' $(git --git-dir=$SOURCE/.git rev-parse HEAD))
function json_escape() {
<?php
use Kdyby;
use Kdyby\RabbitMq\Connection;
use Kdyby\RabbitMq\DI\RabbitMqExtension;
use Nette;
use Nette\Reflection\ClassType;
use PhpAmqpLib\Message\AMQPMessage;
use Tester;
@fprochazka
fprochazka / BaseModel.php
Created May 17, 2011 08:30
Psáno na aktuální Nette (master - 50c3c40)
<?php
abstract class BaseModel extends Nette\Object
{
/** @var NotORM */
protected $connection;
/**
@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' => [