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
{control formProductAdd}
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;
@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');
<?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
<?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
class ExtensionTest extends Tester\TestCase
{
public function testMergingMetadata_simple()
{
$compiler = new CompilerMock();
@fprochazka
fprochazka / Client.php
Created November 8, 2014 23:29
NewRelicProfilingListener
<?php
namespace NewRelic;
use Kdyby;
use Nette;
use Tracy\Debugger;
@fprochazka
fprochazka / dukaz-misto-slibu.php
Created November 12, 2014 13:57
Metody v PHP jsou pomalé #fakt
<?php
class Foo1
{
public function bar()
{
for ($i = 1000000; $i > 0; $i--) {
$result = $this->dance();
import Kefir from 'kefir';
import {List, Stack} from 'immutable';
import {comp, filter, map} from 'transducers-js';
function register(stream, messageType, handler) {
let xform = comp(
filter(x => x.first() === messageType),
map(x => x.rest()));
stream.transduce(xform).onValue(handler);
}