Skip to content

Instantly share code, notes, and snippets.

@nnmer
nnmer / standard.sh
Created August 18, 2019 09:16 — forked from hfossli/standard.sh
Standard bash script format
#!/bin/bash
CLEAR='\033[0m'
RED='\033[0;31m'
function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi
echo "Usage: $0 [-n number-of-people] [-s section-id] [-c cache-file]"
@nnmer
nnmer / AddTranslatedFieldSubscriber.php
Last active May 22, 2019 09:20 — forked from noetix/TranslatedFieldType.php
Translated Field Type for Symfony 2.8
<?php
namespace Acme\DemoBundle\Form\EventListener;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\FormError;