Skip to content

Instantly share code, notes, and snippets.

@korotovsky
korotovsky / IdToObjectTrasformer.php
Last active September 29, 2016 06:24
IdToObjectTrasformer
<?php
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* Class IdToObjectTransformer
*/
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
sudo apt-get install --assume-yes python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install --assume-yes nodejs
sudo apt-get install --assume-yes git
cd /opt && sudo git clone git://github.com/etsy/statsd.git
# StatsD configuration
cat >> /tmp/localConfig.js << EOF
@korotovsky
korotovsky / nginx-retina-rewrite
Created December 18, 2013 10:20
Nginx locations for rewrite ordinary images to retina verstion with falback to ordinary if retina version is not present
###
# Retina images handler
###
if ($http_cookie ~* "isRetina=1" ) {
set $isRetina "retina";
}
location ~ ^/bundles/(.*)-retina\.png {
try_files /bundles/$1-retina.png @retinaFallback;
}