Skip to content

Instantly share code, notes, and snippets.

View gnutix's full-sized avatar

Dorian Villet gnutix

View GitHub Profile
<?php
namespace SymfonyExtension\Component\HttpFoundation;
use Symfony\Component\HttpFoundation\Request as BaseRequest;
use Symfony\Component\HttpFoundation\RequestMatcher as BaseRequestMatcher;
/**
* This class improves Symfony2's RequestMatcher by adding a method to specify the scheme(s) to match.
*/
@gnutix
gnutix / composer.json
Last active December 23, 2015 02:49
Example how to manage verot's upload PHP class dependency with composer.
{
"require": {
"php": ">=5.3.0",
"verot/upload-class": "0.32"
},
"repositories": {
"verot-upload-unofficial": {
"type": "package",
"package": {
"name": "verot/upload-class",
@gnutix
gnutix / AcmeAssetsVersionDependentCommand.php
Last active December 24, 2015 09:18
Example of command that depends on the "framework.templating.assets_version" configuration value.
<?php
namespace Acme\DemoBundle\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
INFO global: Vagrant version: 2.2.4
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_LOG="DEBUG"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/bin/vagrant"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/kernel_v2/plugin.rb
@gnutix
gnutix / CustomDirectoryNamer.php
Last active August 12, 2019 17:58
Workaround to VichUploaderBundle's PRE persist event instead of POST persist, which prevents from accessing / using the entity's generated ID to name the folder or file. Please note that this is not working code but an extract that needs to be adapted for your needs / implementation !
<?php
class CustomDirectoryNamer implements Vich\UploaderBundle\Naming\DirectoryNamerInterface
{
public function directoryName($object, PropertyMapping $mapping): string
{
if (!$object instanceof HasUploadedFile) {
throw new \UnexpectedValueException(
sprintf(
'The class "%s" only supports objects of type "%s".',
self::class,
13115 wget https://www.imagemagick.org/download/ImageMagick.tar.gz
13116 tar xvzf ImageMagick.tar.gz
13117 cd ImageMagick-7.0.8-60/
13118 ./configure
13119 make
13120 sudo make install
13121 sudo ldconfig /usr/local/lib
13122 magick --version
13123 convert --version
services:
Rector\CodingStyle\Rector\Namespace_\ImportFullyQualifiedNamesRector:
# Prevent importing classes like \DateTime
$shouldImportRootNamespaceClasses: false
parameters:
kernel_class: \App\Kernel
sets:
# Code quality
- 'celebrity'
@gnutix
gnutix / crash1.log
Last active November 28, 2019 23:01
Sonarr v3 crash
Nov 28 23:43:56 raspbian mono[5032]: [Info] OwinHostController: Listening on the following URLs:
Nov 28 23:43:56 raspbian mono[5032]: [Info] OwinHostController: http://*:8989/
Nov 28 23:44:09 raspbian mono[5032]: [Info] SonarrBootstrapper: Starting Web Server
Nov 28 23:44:39 raspbian mono[5032]: * Assertion at mini-arm.c:3817, condition `ji' not met
Nov 28 23:44:39 raspbian mono[5032]: =================================================================
Nov 28 23:44:39 raspbian mono[5032]: Native Crash Reporting
Nov 28 23:44:39 raspbian mono[5032]: =================================================================
Nov 28 23:44:39 raspbian mono[5032]: Got a SIGABRT while executing native code. This usually indicates
Nov 28 23:44:39 raspbian mono[5032]: a fatal error in the mono runtime or one of the native libraries
Nov 28 23:44:39 raspbian mono[5032]: used by your application.
@gnutix
gnutix / taxi_start.md
Created June 15, 2020 06:34
Investigation around the behavior of liip/taxi start/stop commands

taxi start

Use case 1 : no previous entries

Given :

27/05/2020
$(function() {
var db = DevExpress.data.AspNet.createStore({
key: "ID",
loadUrl: '/my/route/endpoint'
});
$("#gridContainer").dxDataGrid({
dataSource: {
store: db
},
height: "100%",