Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
View nginx.conf
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
Overlay-on-ajax extension for nette.ajax.js
View ajax.overlay.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');
View BaseControl.php
<?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
View bootstrap.php
<?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');
View Extension.phpt
<?php
class ExtensionTest extends Tester\TestCase
{
public function testMergingMetadata_simple()
{
$compiler = new CompilerMock();
@fprochazka
fprochazka / Client.php
Created Nov 8, 2014
NewRelicProfilingListener
View Client.php
<?php
namespace NewRelic;
use Kdyby;
use Nette;
use Tracy\Debugger;
@fprochazka
fprochazka / dukaz-misto-slibu.php
Created Nov 12, 2014
Metody v PHP jsou pomalé #fakt
View dukaz-misto-slibu.php
<?php
class Foo1
{
public function bar()
{
for ($i = 1000000; $i > 0; $i--) {
$result = $this->dance();
View Application.js
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);
}