Skip to content

Instantly share code, notes, and snippets.

View slashfan's full-sized avatar

Nicolas Cabot slashfan

View GitHub Profile
@svpernova09
svpernova09 / provision.sh
Last active March 18, 2024 17:53
WSL PHP Development
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
# Update Package List
apt-get update
# Update System Packages
apt-get upgrade -y
@Seldaek
Seldaek / ext-requires.txt
Last active February 15, 2020 18:52
PHP Extension Requirements on Packagist.org
Taken from packagist.org
Packages with a master branch update since June 1st 2018: 98977
Of those, package having requires on PHP extensions: 11676 (11.79%)
As only ~12% of packages declare their extension requirements,
and even then it might not be a complete list, take all this with
a big grain of salt, it is informative but definitely not a
complete picture of the most used extensions.
@webdevilopers
webdevilopers / DormerCalculationController.php
Last active February 3, 2019 11:03
Catching domain exceptions when using value objects with data transformers in Symfony forms
<?php
namespace Acme\DormerCalculation\Infrastructure\Symfony\DormerCalculationBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\DormerCalculation\Infrastructure\Symfony\DormerCalculationBundle\Form\DormerCalculation as CalculationForm;
use Acme\DormerCalculation\Domain\Model\DormerCalculation\Command\CalculateDormerCommand;
use Symfony\Component\Form\FormError;
@lsmith77
lsmith77 / DoctrineMigrationTest.php
Last active July 27, 2023 19:12
PHPUnit functional test to check if migrations inside a Symfony app
<?php
namespace AppBundle\Tests;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\DBAL\Driver\PDOMysql\Driver as MySQLDriver;
class DoctrineMigrationTest extends WebTestCase
{
@xcsrz
xcsrz / center_text_on_image.py
Created March 8, 2017 00:17
Center text on an image with Python and OpenCV. Had to come up with it myself as no one was spelling this out anywhere (or google couldn't find it)
#!/usr/bin/env python
import numpy as np
import cv2
from time import sleep
# create blank image - y, x
img = np.zeros((600, 1000, 3), np.uint8)
# setup text
@brenopolanski
brenopolanski / npm-list-globally.md
Created November 1, 2016 19:34
Listing globally installed NPM packages and version
npm list -g --depth=0
@mickaelandrieu
mickaelandrieu / upgrade2.3-to-2.7.md
Last active May 21, 2024 03:39
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
@maximecolin
maximecolin / ConsoleListener.php
Last active August 15, 2023 21:17
Symfony2 : Configuring the Request Context for CLI Command
<?php
namespace Acme\DemoBundle\EventListener;
use Symfony\Component\Routing\RouterInterface;
class ConsoleListener
{
/**
* @var RouterInterface
@helios-ag
helios-ag / config.yml
Created September 8, 2014 05:09
Monolog loggger configuration for Graylog2 (Symfony2)
services:
gelf.udp.transport:
class: Gelf\Transport\UdpTransport
gelf.publisher:
class: Gelf\Publisher
arguments: [@gelf.udp.transport]
monolog.gelf_handler:
class: Monolog\Handler\GelfHandler
arguments: [@gelf.publisher]
@staltz
staltz / introrx.md
Last active September 24, 2024 06:42
The introduction to Reactive Programming you've been missing