Skip to content

Instantly share code, notes, and snippets.

View File.orm.yml
type: entity
table: files
prePersist: [upload]
preUpdate: [upload]
preRemove: [remove]
View PromotionExpressionValidator.php
class PromotionExpressionValidator extends ConstraintValidator
private $expressionLanguage;
private $loadDummyOrder;
public function __construct(
ExpressionLanguage $expressionLanguage,
LoadDummyOrder $loadDummyOrder
View appProdProjectContainer.php
protected function getTranslator_DefaultService()
$this->services['translator.default'] = $instance = new \Symfony\Bundle\FrameworkBundle\Translation\Translator($this, new \Symfony\Component\Translation\MessageSelector(), array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), '' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini')), array('cache_dir' => (__DIR__.'/translations'), 'debug' => false));
$instance->setFallbackLocales(array(0 => 'en'));
$instance->addResource('xlf', (dirname(dirname(dirname(__DIR__))).'/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/'), 'sv', 'validators
umpirsky /
Created Jun 25, 2014
Convert all jpg images from folder into animated gif.
mogrify -verbose -resample 72x72 -resize 512x512 *.jpg
exiftran -a -no -i *.jpg
convert -verbose -delay 15 -loop 0 *.jpg fun.gif
umpirsky / grub
Created Jun 14, 2014
Reinstall GRUB
View grub
sudo mount /dev/dm-2 /mnt
sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/dm-2
umpirsky /
Created Apr 29, 2014
PermissionsHandler test.

Steps to test PermissionsHandler script:

$ git clone
$ cd
$ git checkout feature/permissions-handler
$ composer install
$ cd web
$ php -S localhost:8888
$ chromium-browser http://localhost:8888/config.php (or whatever web browser)
umpirsky / A.markdown
Last active Jan 14, 2022 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
View A.markdown
umpirsky / kill-me-please
Created Apr 18, 2013
After running this recursive script on Linux, you are screwed!
View kill-me-please
View update