Skip to content

Instantly share code, notes, and snippets.

View arnolanglade's full-sized avatar

Arnaud Langlade arnolanglade

View GitHub Profile
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@artemgordinskiy
artemgordinskiy / node-npm-in-docker.sh
Created December 11, 2015 14:00
Run Node/NPM in a Docker container
# For example, run "npm install"
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container
# Great Success!
@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.
@lolautruche
lolautruche / 0 - Readme.md
Last active August 29, 2015 14:04
Oro DistributionBundle split

Subtree split of OroCRM/DistributionBundle

  1. Clone the base repository into oro-platform directory:

    git clone git@github.com:lolautruche/platform.git oro-platform
    git remote add upstream git@github.com:orocrm/platform.git
    git config branch.master.remote upstream
  2. Run the 2 shell scripts, split_oro_config_component.sh and split_oro_distribution_bundle.sh

@nidup
nidup / gist:9485426
Created March 11, 2014 13:18
Download Crowdin translations + create PR
<?php
$app
->get('/crowdin/pull', function (Request $request) use ($app) {
$responses = array();
$config = $app['config']['crowdin']['download'];
$app['crowdin']->api('export')->execute();
if (!is_dir($config['base_dir'])) {
@webmozart
webmozart / README.md
Last active July 22, 2018 13:38
Composer Resource Integration
@jakzal
jakzal / FindPackageListsCommand.php
Created January 16, 2014 14:19
How to spec a Symfony2 console command?
<?php
namespace Zalas\Bundle\PackagistBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class FindPackageListsCommand extends ContainerAwareCommand
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@tiraeth
tiraeth / PostgreSqlPlatform.php
Created October 2, 2013 10:29
How to override default platform in Doctrine2 with Symfony2. Example: Force RESTART IDENTITY for TRUNCATE in PostgreSQL when used in "test" environment. This will help you with functional tests as you will always have the same ids.
<?php
namespace Acme\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform as DoctrinePostgreSqlPlatform;
class PostgreSqlPlatform extends DoctrinePostgreSqlPlatform
{
public function getTruncateTableSQL($tableName, $cascade = false)
{
@mnapoli
mnapoli / reference.yml
Last active January 12, 2023 00:08
Doctrine YAML configuration reference
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance