Skip to content

Instantly share code, notes, and snippets.

View jiri-jagos's full-sized avatar

Jiri Jagos jiri-jagos

View GitHub Profile
View gist:35860210e25b84ebd1a6
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 / config.yml
Last active August 29, 2015 14:20
Is filtering elastichsearch result item nested fields (by e.g. geolocation) possible?
View config.yml
### MAPPING ###
type: 'boolean'
type: 'string'
analyzer: 'standard'
View screenshots.js
* 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
var casper = require("casper").create();
jiri-jagos /
Created September 24, 2015 20:42 — forked from magnetikonline/
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 / Generator.php
Created September 30, 2015 14:48
unserialize hack
View Generator.php
$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 / services.yml
Created September 18, 2013 07:30
lambda function in yaml
View services.yml
class: SAVerlag\SearchBundle\Logic\ElasticDocumentStructureHelper
- [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 / build.xml
Last active March 22, 2016 19:08 — forked from hectorsanjuan/build.xml
Phing build.xml for Symfony2 projects
View build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
<!-- Properties -->
<property name="" value="${project.basedir}/app" />
<property name="dir.src" value="${project.basedir}/src" />
<property name="" value="${project.basedir}/app/build" />
<!--<property name="" value="${}/docs" />-->
<!--<property name="" value="${}/phpdoc" />-->
<!--<property name="" value="${}/docblox" />-->
<property name="dir.reports" value="${}/logs" />
jiri-jagos / DoctrineDbalStatementInterface.php
Created March 23, 2016 16:49 — forked from gnutix/DoctrineDbalStatementInterface.php
Mock Builder for Doctrine EntityManager / Connection mock objects.
View DoctrineDbalStatementInterface.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 /
Created February 2, 2018 12:40 — forked from phillipgreenii/
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