Skip to content

Instantly share code, notes, and snippets.

@Padam87
Padam87 / PhpFunctionExtension.php
Created October 17, 2016 18:58
Sonata list route type
<?php
class PhpFunctionExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getFunctions()
{
return [
@Padam87
Padam87 / clone-sandbox.sh
Last active April 5, 2016 11:33
LXC scripts
#!/bin/bash -
#===============================================================================
#
# FILE: clone-sandbox.sh
#
# USAGE: ./clone-sandbox.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
@Padam87
Padam87 / .php_cs
Last active October 19, 2015 22:31
My PHP CS
<?php
return Symfony\CS\Config\Symfony23Config::create()
->fixers(
[
'-concat_without_spaces',
'concat_with_spaces',
'ordered_use',
'short_array_syntax',
]
@Padam87
Padam87 / app_prod.yml
Created October 9, 2014 13:10
Symfony autogenerate assets_version
imports:
- { resource: ../../assets_version.yml }
framework:
templating:
assets_version: %assets_version%
@Padam87
Padam87 / .htaccess
Created July 31, 2014 19:27
Symfony htaccess
# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# startpage (path "/") because otherwise Apache will apply the rewritting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
<IfModule mod_dir.c>
DirectoryIndex app.php
</IfModule>
<IfModule mod_authz_core.c>
@Padam87
Padam87 / AppKernel.php
Last active August 29, 2015 13:56
Symfony2 bundle functional test suite with Doctrine
<?php
// Tests/App/app/AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
@Padam87
Padam87 / ffmpeg-singleaudiostream.sh
Last active October 7, 2019 15:57
Remove unnecessary audio streams from video files using ffmpeg.
#!/bin/bash
files=${1-"*.avi"};
audio_stream=${2-"0:1"};
video_stream=${3-"0:0"};
output_dir=${4-output};
echo -e "\e[0;33m";
echo " Files: $files";
echo "Video stream: $video_stream";