Skip to content

Instantly share code, notes, and snippets.

View jiri-jagos's full-sized avatar

Jiri Jagos jiri-jagos

View GitHub Profile
diff --git a/src/Zazitky/FrontEndBundle/Controller/CertificateProlongationController.php b/src/Zazitky/FrontEndBundle/Controller/CertificateProlongationController.php
index b578cd0..2059df5 100644
--- a/src/Zazitky/FrontEndBundle/Controller/CertificateProlongationController.php
+++ b/src/Zazitky/FrontEndBundle/Controller/CertificateProlongationController.php
@@ -156,9 +156,9 @@ class CertificateProlongationController extends BaseController
$flashMessage = <<<FLASH
<div class="htmlContent">
- <p>A je to! Objednávka prodloužení vašeho Certifikátu na zážitek byla úspěšně odeslána.</p>
- <p>V emailu najdete údaje k platbě poplatku za prodloužení. Po přijetí platby vám odešleme prodloužený Certifikát na vaší emailovou adresu.</p>
@jiri-jagos
jiri-jagos / config.yml
Last active August 29, 2015 14:20
Is filtering elastichsearch result item nested fields (by e.g. geolocation) possible?
### MAPPING ###
elastic_company_document_mapping:
testing:
type: 'boolean'
type:
type: 'string'
analyzer: 'standard'
fields:
folded:
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@jiri-jagos
jiri-jagos / README.md
Created September 24, 2015 20:42 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).

The related Nginx options are:

@jiri-jagos
jiri-jagos / Generator.php
Created September 30, 2015 14:48
unserialize hack
$object = @unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className));
if ($object === false) {
$object = unserialize(sprintf('C:%d:"%s":0:{}', strlen($className), $className));
}
@jiri-jagos
jiri-jagos / services.yml
Created September 18, 2013 07:30
lambda function in yaml
elastic_document_structure_helper:
class: SAVerlag\SearchBundle\Logic\ElasticDocumentStructureHelper
calls:
- [addEntityWantedFields, ['SAVerlag\FinderBundle\Entity\Certificate', ['type', 'other_type_name']]]
- [addEntityWantedFields, ['SAVerlag\FinderBundle\Entity\Company', ['id', 'name', 'employees_craft_total', 'employees_tech_total', 'employees_total', 'short_description', 'description', 'specialization', 'funding_year', 'action_radius', 'action_radius_distance', 'email', 'phone', 'fax', 'turnover', 'contract_volume_min', 'contract_volume_max']]]
- [addEntityWantedFields, ['SAVerlag\FinderBundle\Entity\Project', {'project_name': 'name', 'project_description': 'description', 'project_segment': 'segment_id', 0: 'executed_activities_text', 1: 'contract_volume', 2: 'builder', 3: 'architect'}]]
- [addEntityWantedFields, ['SAVerlag\FinderBundle\Entity\Location', ['street', 'zip_code', 'city', 'longitude', 'latitude']]]
- [addEntityWantedFields, ['SAVerlag\FinderBundle\En
@jiri-jagos
jiri-jagos / build.xml
Last active March 22, 2016 19:08 — forked from hectorsanjuan/build.xml
Phing build.xml for Symfony2 projects
<?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
<!-- Properties -->
<property name="dir.app" value="${project.basedir}/app" />
<property name="dir.src" value="${project.basedir}/src" />
<property name="dir.build" value="${project.basedir}/app/build" />
<!--<property name="dir.docs" value="${dir.build}/docs" />-->
<!--<property name="dir.docs.phpdoc" value="${dir.docs}/phpdoc" />-->
<!--<property name="dir.docs.docblox" value="${dir.docs}/docblox" />-->
<property name="dir.reports" value="${dir.build}/logs" />
@jiri-jagos
jiri-jagos / DoctrineDbalStatementInterface.php
Created March 23, 2016 16:49 — forked from gnutix/DoctrineDbalStatementInterface.php
Mock Builder for Doctrine EntityManager / Connection mock objects.
<?php
namespace Mocks;
use Doctrine\DBAL\Driver\Statement;
/**
* Doctrine DBAL Statement implementing \Iterator.
*
* This class has been created because of a bug in PHPUnit Mock Objects.

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@jiri-jagos
jiri-jagos / README.md
Created February 2, 2018 12:40 — forked from phillipgreenii/README.md
Running NPM Scripts through maven

I am in the process of introducing single page applications to where I work. For development, using node based build tools is much easier for the single page applications. However, the build process for our organization is based upon maven. Our solution started with the maven plugin frontend-maven-plugin. It worked great at first, but then we ran into a situation that I couldn't make work with it.

As stated before, at our organization, we have the older ecosystem which is maven and the newer ecosystem which is node. Our goal was to keep the hacking to a minimum. We did this by putting all of the hacks into a single super node based build file. This is what maven calls and the reason frontend-maven-plugin wasn't sufficient. The super node based build script calls all of the other build scripts by spawning npm run. Try as I might, I could not figure out how to make the spawn work. front-end-maven-plugin downloads npm